diff --git a/swaggerci/apimanagement/generated/api/ApiManagementClient.cs b/swaggerci/apimanagement/generated/api/ApiManagementClient.cs new file mode 100644 index 000000000000..4bb6c6573a72 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/ApiManagementClient.cs @@ -0,0 +1,82724 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (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 + { + + /// + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 ApiDelete(string resourceGroupName, string serviceName, 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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,onOk,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 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 ApiDeleteViaIdentity(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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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,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 ApiDelete_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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// The ID of the target 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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// The ID of the target subscription. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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 = @"2022-08-01"; + // 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 = @"2022-08-01"; + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ApiManagementServiceResource.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ApiManagementServiceResource.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // 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.Api20220801.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 = @"2022-08-01"; + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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. + /// 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.Api20220801.IApiManagementServiceCheckNameAvailabilityParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ApiManagementServiceResource.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // 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 = @"2022-08-01"; + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ApiManagementServiceResource.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Lists all API Management services within an Azure subscription. + /// The ID of the target 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 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 = @"2022-08-01"; + // 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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; } + // 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. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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; } + // 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.Api20220801.ApiManagementServiceResource.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ApiManagementServiceResource.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ApiManagementServiceResource.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // 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 = @"2022-08-01"; + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,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. + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,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. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api30.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api30.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api30.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api30.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// The ID of the target 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 ApiWikisList(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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.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. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.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.Api20220801.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.Api30.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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 subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// 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, 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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; } + // 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. + /// 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, 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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; } + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// Content type contract 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 ContentTypeCreateOrUpdate(string resourceGroupName, string serviceName, string contentTypeId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// Content type contract 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 ContentTypeCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// Content type 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 ContentTypeCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string contentTypeId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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 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 = @"2022-08-01"; + // 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 = @"2022-08-01"; + // 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.Api20220801.DeletedServiceContract.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(location),location); + } + } + + /// + /// Lists all soft-deleted services available for undelete for the given subscription. + /// + /// The ID of the target 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 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 = @"2022-08-01"; + // 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 = @"2022-08-01"; + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 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 = @"2022-08-01"; + // 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 = @"2022-08-01"; + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api30.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// The ID of the target 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 DocumentationListByService(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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.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. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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 subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// 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 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.INetworkStatusContractByLocation) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Gets the network endpoints of all outbound dependencies of a ApiManagement service. + /// + /// The ID of the target subscription. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// | 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// | 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Create or update the developer portal configuration. + /// The ID of the target subscription. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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 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.Api20220801.IPortalConfigContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Update the developer portal configuration. + /// The ID of the target subscription. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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 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.Api20220801.IPortalConfigContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Gets the private link resources + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + 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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + 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. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target 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 ProductWikisList(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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.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. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.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.Api20220801.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.Api30.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// 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 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 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 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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,onOk,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 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 UserDeleteViaIdentity(global::System.String viaIdentity, bool? deleteSubscriptions, bool? notify, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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,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 UserDelete_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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.498/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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to 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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// an 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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// 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. + /// 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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.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.Api20220801.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 = @"2022-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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.Api20220801.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.Api20220801.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but 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. + /// 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.Api20220801.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.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Any.cs b/swaggerci/apimanagement/generated/api/Models/Any.cs new file mode 100644 index 000000000000..afcb245debeb --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Any.json.cs b/swaggerci/apimanagement/generated/api/Models/Any.json.cs new file mode 100644 index 000000000000..26eb6e3b06a3 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateEndpoint.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateEndpoint.cs new file mode 100644 index 000000000000..ba3c36b5a47a --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateEndpoint.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateEndpoint.json.cs new file mode 100644 index 000000000000..cfe4bd331ec8 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateEndpointConnection.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..062ed2937ec6 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateEndpointConnection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateEndpointConnection.json.cs new file mode 100644 index 000000000000..dd938a41b2b4 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateEndpointConnectionListResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..631c43306e23 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateEndpointConnectionListResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateEndpointConnectionListResult.json.cs new file mode 100644 index 000000000000..b0ae0ca195f7 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateEndpointConnectionProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..fa1b0eb685c7 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateEndpointConnectionProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateEndpointConnectionProperties.json.cs new file mode 100644 index 000000000000..fb884ae4568e --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateLinkResource.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateLinkResource.cs new file mode 100644 index 000000000000..2e49ebc13de9 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateLinkResource.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateLinkResource.json.cs new file mode 100644 index 000000000000..cd4ce57cfc53 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateLinkResourceListResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateLinkResourceListResult.cs new file mode 100644 index 000000000000..ed3a92bd9c8f --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateLinkResourceListResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateLinkResourceListResult.json.cs new file mode 100644 index 000000000000..2e2a26c1dec5 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateLinkResourceProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..5084cd0e46a8 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateLinkResourceProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateLinkResourceProperties.json.cs new file mode 100644 index 000000000000..5f9b47d69ed6 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateLinkServiceConnectionState.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..4e05edb9dfd0 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/PrivateLinkServiceConnectionState.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20/PrivateLinkServiceConnectionState.json.cs new file mode 100644 index 000000000000..a19c4bdeb9d6 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/ProxyResourceAutoGenerated.cs b/swaggerci/apimanagement/generated/api/Models/Api20/ProxyResourceAutoGenerated.cs new file mode 100644 index 000000000000..75ae4f4778b5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20/ProxyResourceAutoGenerated.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 ProxyResourceAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IProxyResourceAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IProxyResourceAutoGeneratedInternal, + 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 ProxyResourceAutoGenerated() + { + + } + + /// 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 IProxyResourceAutoGenerated : + 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 IProxyResourceAutoGeneratedInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20/ProxyResourceAutoGenerated.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20/ProxyResourceAutoGenerated.json.cs new file mode 100644 index 000000000000..6730be9556f1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20/ProxyResourceAutoGenerated.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 ProxyResourceAutoGenerated + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref 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.IProxyResourceAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IProxyResourceAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IProxyResourceAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProxyResourceAutoGenerated(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProxyResourceAutoGenerated(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/generated/api/Models/Api20/Resource.cs b/swaggerci/apimanagement/generated/api/Models/Api20/Resource.cs new file mode 100644 index 000000000000..66801a2946b5 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20/Resource.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20/Resource.json.cs new file mode 100644 index 000000000000..1a4e7e0ecbb9 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api20220801/AccessInformationCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationCollection.cs new file mode 100644 index 000000000000..af76662fde5d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged AccessInformation list representation. + public partial class AccessInformationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationCollection.json.cs new file mode 100644 index 000000000000..1d742c9987c9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAccessInformationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AccessInformationContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationContract.cs new file mode 100644 index 000000000000..3d77f92c24d0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant Settings. + public partial class AccessInformationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationContractPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationContractPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationContractPropertiesInternal)Property).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IAccessInformationContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationContract.json.cs new file mode 100644 index 000000000000..b3d214dafaf7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AccessInformationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AccessInformationContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationContractProperties.cs new file mode 100644 index 000000000000..196d5ee85cdf --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAccessInformationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AccessInformationContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationContractProperties.json.cs new file mode 100644 index 000000000000..770c2d58c274 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAccessInformationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AccessInformationCreateParameterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationCreateParameterProperties.cs new file mode 100644 index 000000000000..8419eab56d22 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAccessInformationCreateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AccessInformationCreateParameterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationCreateParameterProperties.json.cs new file mode 100644 index 000000000000..7015273908bf --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAccessInformationCreateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationCreateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AccessInformationCreateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationCreateParameters.cs new file mode 100644 index 000000000000..e32f60a3ff57 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information update parameters. + public partial class AccessInformationCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationCreateParameterPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationCreateParameterPropertiesInternal)Property).Enabled = value ?? default(bool); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationCreateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationCreateParameterPropertiesInternal)Property).PrimaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationCreateParameterPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationCreateParameterPropertiesInternal)Property).PrincipalId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationCreateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationCreateParameterPropertiesInternal)Property).SecondaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/AccessInformationCreateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationCreateParameters.json.cs new file mode 100644 index 000000000000..280c4fc5118f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AccessInformationCreateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AccessInformationSecretsContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationSecretsContract.cs new file mode 100644 index 000000000000..1af92b7871dd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAccessInformationSecretsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/AccessInformationSecretsContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationSecretsContract.json.cs new file mode 100644 index 000000000000..c46afdbed7c9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAccessInformationSecretsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationSecretsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AccessInformationUpdateParameterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationUpdateParameterProperties.cs new file mode 100644 index 000000000000..730e69038488 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAccessInformationUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AccessInformationUpdateParameterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..e4a2ab1def9f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAccessInformationUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AccessInformationUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationUpdateParameters.cs new file mode 100644 index 000000000000..3ab9d44e5c31 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information update parameters. + public partial class AccessInformationUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationUpdateParameterPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationUpdateParameterPropertiesInternal)Property).Enabled = value ?? default(bool); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.AccessInformationUpdateParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAccessInformationUpdateParameterProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AccessInformationUpdateParameters.json.cs new file mode 100644 index 000000000000..71bdad6ff4b7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AccessInformationUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAccessInformationUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AdditionalLocation.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AdditionalLocation.cs new file mode 100644 index 000000000000..edbe4711b86d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAdditionalLocation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAdditionalLocationInternal.GatewayRegionalUrl { get => this._gatewayRegionalUrl; set { {_gatewayRegionalUrl = value;} } } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAdditionalLocationInternal.PlatformVersion { get => this._platformVersion; set { {_platformVersion = value;} } } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAdditionalLocationInternal.PrivateIPAddress { get => this._privateIPAddress; set { {_privateIPAddress = value;} } } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAdditionalLocationInternal.PublicIPAddress { get => this._publicIPAddress; set { {_publicIPAddress = value;} } } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceSkuProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAdditionalLocationInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceSkuProperties()); set { {_sku = value;} } } + + /// Internal Acessors for VirtualNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAdditionalLocationInternal.VirtualNetworkConfiguration { get => (this._virtualNetworkConfiguration = this._virtualNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.VirtualNetworkConfiguration()); set { {_virtualNetworkConfiguration = value;} } } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAdditionalLocationInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Subnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Subnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAdditionalLocationInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Vnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceSkuProperties Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceSkuPropertiesInternal)Sku).Capacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceSkuPropertiesInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceSkuPropertiesInternal)Sku).Name = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get => (this._virtualNetworkConfiguration = this._virtualNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).SubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/AdditionalLocation.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AdditionalLocation.json.cs new file mode 100644 index 000000000000..915ab22dbb44 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApiManagementServiceSkuProperties.FromJson(__jsonSku) : Sku;} + {_virtualNetworkConfiguration = If( json?.PropertyT("virtualNetworkConfiguration"), out var __jsonVirtualNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAdditionalLocation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAdditionalLocation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiCollection.cs new file mode 100644 index 000000000000..9d3dc7b681a2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged API list representation. + public partial class ApiCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiCollection.json.cs new file mode 100644 index 000000000000..0563908c13da --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiContactInformation.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContactInformation.cs new file mode 100644 index 000000000000..5633c28d96cc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API contact information + public partial class ApiContactInformation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContactInformation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiContactInformation.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContactInformation.json.cs new file mode 100644 index 000000000000..9028529f5e75 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiContactInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContactInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContract.cs new file mode 100644 index 000000000000..551762cd1926 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContract.cs @@ -0,0 +1,703 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API details. + public partial class ApiContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSetDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSetVersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSetVersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSetVersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).LicenseUrl = 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 ApiVersionSet + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContractDetails Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractInternal.ApiVersionSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSet = value; } + + /// Internal Acessors for AuthenticationSetting + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractInternal.AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSetting = value; } + + /// Internal Acessors for AuthenticationSettingOAuth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractInternal.AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2 = value; } + + /// Internal Acessors for AuthenticationSettingOpenid + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractInternal.AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid = value; } + + /// Internal Acessors for Contact + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContactInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractInternal.Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).Contact = value; } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).IsOnline = value; } + + /// Internal Acessors for License + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiLicenseInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractInternal.License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).License = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for SubscriptionKeyParameterName + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionKeyParameterNamesContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractInternal.SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal)Property).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal)Property).Protocol = value ?? null /* arrayOf */; } + + /// + /// 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.Api20220801.IApiContractPropertiesInternal)Property).ServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).SourceApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractInternal)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 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.Api20220801.IOAuth2AuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + + [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; } + /// 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; } + /// + /// 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.Api20220801.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.Api20220801.IAuthenticationSettingsContract AuthenticationSetting { get; set; } + /// OAuth2 Authentication settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// OpenID Connect Authentication Settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + /// Contact information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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; } + /// + /// 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.Api20220801.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; } + /// + /// 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.Api20220801.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/generated/api/Models/Api20220801/ApiContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContract.json.cs new file mode 100644 index 000000000000..c09d12bc7184 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApiContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContractProperties.cs new file mode 100644 index 000000000000..72148b2508b6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContractProperties.cs @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Entity Properties + public partial class ApiContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContract __apiEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionDescription = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetails ApiVersionSet { get => (this._apiVersionSet = this._apiVersionSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthenticationSettingsContract AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContactInformation Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiLicenseInformation License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl = value ?? null; } + + /// Internal Acessors for ApiVersionSet + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContractDetails Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal.ApiVersionSet { get => (this._apiVersionSet = this._apiVersionSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiVersionSetContractDetails()); set { {_apiVersionSet = value;} } } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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. 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.Api20220801.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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; } + /// + /// 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.Api20220801.IApiEntityBaseContractInternal + { + /// Version set details + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + /// + /// 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/generated/api/Models/Api20220801/ApiContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContractProperties.json.cs new file mode 100644 index 000000000000..ad5f30c9fea9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContractProperties.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.Api20220801 +{ + 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.Api20220801.ApiEntityBaseContract(json); + {_apiVersionSet = If( json?.PropertyT("apiVersionSet"), out var __jsonApiVersionSet) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContractUpdateProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContractUpdateProperties.cs new file mode 100644 index 000000000000..76017437a137 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API update contract properties. + public partial class ApiContractUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractUpdatePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContract __apiEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthenticationSettingsContract AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContactInformation Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiLicenseInformation License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl = value ?? null; } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiContractUpdateProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiContractUpdateProperties.json.cs new file mode 100644 index 000000000000..c68949dad14f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IApiContractUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiCreateOrUpdateParameter.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiCreateOrUpdateParameter.cs new file mode 100644 index 000000000000..7923199afb79 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiCreateOrUpdateParameter.cs @@ -0,0 +1,754 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Create or Update Parameters. + public partial class ApiCreateOrUpdateParameter : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameter, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSetDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSetVersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSetVersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSetVersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Format of the Content in which the API is getting imported. + [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.Api20220801.IApiCreateOrUpdatePropertiesInternal)Property).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).LicenseUrl = value ?? null; } + + /// Internal Acessors for ApiVersionSet + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContractDetails Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameterInternal.ApiVersionSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal)Property).ApiVersionSet = value; } + + /// Internal Acessors for AuthenticationSetting + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameterInternal.AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSetting = value; } + + /// Internal Acessors for AuthenticationSettingOAuth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameterInternal.AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2 = value; } + + /// Internal Acessors for AuthenticationSettingOpenid + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameterInternal.AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid = value; } + + /// Internal Acessors for Contact + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContactInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameterInternal.Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).Contact = value; } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameterInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).IsOnline = value; } + + /// Internal Acessors for License + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiLicenseInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameterInternal.License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).License = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameterInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiCreateOrUpdateProperties()); set { {_property = value;} } } + + /// Internal Acessors for SubscriptionKeyParameterName + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionKeyParameterNamesContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameterInternal.SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterName = value; } + + /// Internal Acessors for WsdlSelector + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdatePropertiesWsdlSelector Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameterInternal.WsdlSelector { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdatePropertiesInternal)Property).WsdlSelector; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal)Property).Path = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiCreateOrUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal)Property).Protocol = value ?? null /* arrayOf */; } + + /// + /// 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.Api20220801.IApiContractPropertiesInternal)Property).ServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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. + /// + [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.Api20220801.IApiCreateOrUpdatePropertiesInternal)Property).SoapApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)Property).SourceApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiCreateOrUpdatePropertiesInternal)Property).TranslateRequiredQueryParametersConduct; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiCreateOrUpdatePropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiCreateOrUpdatePropertiesInternal)Property).WsdlSelectorWsdlEndpointName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiCreateOrUpdatePropertiesInternal)Property).WsdlSelectorWsdlServiceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Format of the Content in which the API is getting imported.", + 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; } + /// + /// 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. + /// + [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.", + 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.Api20220801.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.Api20220801.IAuthenticationSettingsContract AuthenticationSetting { get; set; } + /// OAuth2 Authentication settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// OpenID Connect Authentication Settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + /// Contact information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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. + 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.Api20220801.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.Api20220801.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; } + /// + /// 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. + /// + 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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiCreateOrUpdateParameter.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiCreateOrUpdateParameter.json.cs new file mode 100644 index 000000000000..4ad1766c9f11 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApiCreateOrUpdateProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateParameter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiCreateOrUpdateProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiCreateOrUpdateProperties.cs new file mode 100644 index 000000000000..4d79329b61df --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiCreateOrUpdateProperties.cs @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Create or Update Properties. + public partial class ApiCreateOrUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdatePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractProperties __apiContractProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetails ApiVersionSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetVersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetVersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetVersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthenticationSettingsContract AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContactInformation Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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. + [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.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiLicenseInformation License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).LicenseUrl = value ?? null; } + + /// Internal Acessors for WsdlSelector + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdatePropertiesWsdlSelector Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdatePropertiesInternal.WsdlSelector { get => (this._wsdlSelector = this._wsdlSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiCreateOrUpdatePropertiesWsdlSelector()); set { {_wsdlSelector = value;} } } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).Protocol = value ?? null /* arrayOf */; } + + /// + /// 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.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).ServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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. + /// + [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.Api20220801.IApiContractPropertiesInternal)__apiContractProperties).SourceApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiContractProperties).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiCreateOrUpdatePropertiesWsdlSelector WsdlSelector { get => (this._wsdlSelector = this._wsdlSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiCreateOrUpdatePropertiesWsdlSelectorInternal)WsdlSelector).WsdlEndpointName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiCreateOrUpdatePropertiesWsdlSelectorInternal)WsdlSelector).WsdlServiceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractProperties + { + /// Format of the Content in which the API is getting imported. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Format of the Content in which the API is getting imported.", + 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. + /// + [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.", + 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.Api20220801.IApiContractPropertiesInternal + { + /// Format of the Content in which the API is getting imported. + 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. + /// + 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.Api20220801.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/generated/api/Models/Api20220801/ApiCreateOrUpdateProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiCreateOrUpdateProperties.json.cs new file mode 100644 index 000000000000..e7ba26626512 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApiContractProperties(json); + {_wsdlSelector = If( json?.PropertyT("wsdlSelector"), out var __jsonWsdlSelector) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiCreateOrUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiCreateOrUpdatePropertiesWsdlSelector.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiCreateOrUpdatePropertiesWsdlSelector.cs new file mode 100644 index 000000000000..b24c02dbc57b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiCreateOrUpdatePropertiesWsdlSelector, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiCreateOrUpdatePropertiesWsdlSelector.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiCreateOrUpdatePropertiesWsdlSelector.json.cs new file mode 100644 index 000000000000..adb1980e7fc4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiCreateOrUpdatePropertiesWsdlSelector. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiCreateOrUpdatePropertiesWsdlSelector. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiEntityBaseContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiEntityBaseContract.cs new file mode 100644 index 000000000000..59b20df3b35b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API base contract details. + public partial class ApiEntityBaseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IAuthenticationSettingsContract AuthenticationSetting { get => (this._authenticationSetting = this._authenticationSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).OpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).OpenidAuthenticationSetting = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContactInformation Contact { get => (this._contact = this._contact ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContactInformationInternal)Contact).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContactInformationInternal)Contact).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContactInformationInternal)Contact).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiLicenseInformation License { get => (this._license = this._license ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiLicenseInformationInternal)License).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiLicenseInformationInternal)License).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiLicenseInformationInternal)License).Url = value ?? null; } + + /// Internal Acessors for AuthenticationSetting + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal.AuthenticationSetting { get => (this._authenticationSetting = this._authenticationSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.AuthenticationSettingsContract()); set { {_authenticationSetting = value;} } } + + /// Internal Acessors for AuthenticationSettingOAuth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal.AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2 = value; } + + /// Internal Acessors for AuthenticationSettingOpenid + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal.AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).Openid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).Openid = value; } + + /// Internal Acessors for Contact + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContactInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal.Contact { get => (this._contact = this._contact ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiContactInformation()); set { {_contact = value;} } } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal.IsOnline { get => this._isOnline; set { {_isOnline = value;} } } + + /// Internal Acessors for License + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiLicenseInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal.License { get => (this._license = this._license ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiLicenseInformation()); set { {_license = value;} } } + + /// Internal Acessors for SubscriptionKeyParameterName + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionKeyParameterNamesContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal.SubscriptionKeyParameterName { get => (this._subscriptionKeyParameterName = this._subscriptionKeyParameterName ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContractInternal)AuthenticationSetting).OpenidProviderId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get => (this._subscriptionKeyParameterName = this._subscriptionKeyParameterName ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionKeyParameterNamesContractInternal)SubscriptionKeyParameterName).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionKeyParameterNamesContractInternal)SubscriptionKeyParameterName).Query; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthenticationSettingsContract AuthenticationSetting { get; set; } + /// OAuth2 Authentication settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// OpenID Connect Authentication Settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + /// Contact information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiEntityBaseContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiEntityBaseContract.json.cs new file mode 100644 index 000000000000..32b778481b3d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AuthenticationSettingsContract.FromJson(__jsonAuthenticationSettings) : AuthenticationSetting;} + {_subscriptionKeyParameterName = If( json?.PropertyT("subscriptionKeyParameterNames"), out var __jsonSubscriptionKeyParameterNames) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.SubscriptionKeyParameterNamesContract.FromJson(__jsonSubscriptionKeyParameterNames) : SubscriptionKeyParameterName;} + {_contact = If( json?.PropertyT("contact"), out var __jsonContact) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiContactInformation.FromJson(__jsonContact) : Contact;} + {_license = If( json?.PropertyT("license"), out var __jsonLicense) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiExportResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiExportResult.cs new file mode 100644 index 000000000000..9f82619827ff --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Export result. + public partial class ApiExportResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiExportResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiExportResultValue Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiExportResultInternal.Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiExportResultValue()); set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiExportResultValue Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiExportResultValueInternal)Value).Link; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiExportResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiExportResult.json.cs new file mode 100644 index 000000000000..330101bb261e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IApiExportResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiExportResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiExportResultValue.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiExportResultValue.cs new file mode 100644 index 000000000000..ae5235138f9c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiExportResultValue, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiExportResultValue.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiExportResultValue.json.cs new file mode 100644 index 000000000000..a385dfd42360 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiExportResultValue. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiExportResultValue. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiLicenseInformation.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiLicenseInformation.cs new file mode 100644 index 000000000000..a9333c9e3dfd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API license information + public partial class ApiLicenseInformation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiLicenseInformation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiLicenseInformation.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiLicenseInformation.json.cs new file mode 100644 index 000000000000..24e3036c6901 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiLicenseInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiLicenseInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceApplyNetworkConfigurationParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceApplyNetworkConfigurationParameters.cs new file mode 100644 index 000000000000..d6ced586c2d8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceApplyNetworkConfigurationParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceApplyNetworkConfigurationParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceApplyNetworkConfigurationParameters.json.cs new file mode 100644 index 000000000000..3a4f3cad7b3c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceApplyNetworkConfigurationParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceApplyNetworkConfigurationParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceBackupRestoreParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBackupRestoreParameters.cs new file mode 100644 index 000000000000..d2554bbd1aa2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceBackupRestoreParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceBackupRestoreParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBackupRestoreParameters.json.cs new file mode 100644 index 000000000000..cafdb7950789 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceBackupRestoreParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBackupRestoreParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceBaseProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBaseProperties.cs new file mode 100644 index 000000000000..a8abc9bea89a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBaseProperties.cs @@ -0,0 +1,784 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + 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.Api20220801.IApiManagementServiceBaseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAdditionalLocation[] AdditionalLocation { get => this._additionalLocation; set => this._additionalLocation = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionConstraint ApiVersionConstraint { get => (this._apiVersionConstraint = this._apiVersionConstraint ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionConstraintInternal)ApiVersionConstraint).MinApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionConstraintInternal)ApiVersionConstraint).MinApiVersion = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration[] Certificate { get => this._certificate; set => this._certificate = value; } + + /// 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.Api20220801.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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get => (this._customProperty = this._customProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceBasePropertiesCustomProperties()); set => this._customProperty = 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.Api20220801.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.Api20220801.IHostnameConfiguration[] HostnameConfiguration { get => this._hostnameConfiguration; set => this._hostnameConfiguration = 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.Api20220801.IApiVersionConstraint Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.ApiVersionConstraint { get => (this._apiVersionConstraint = this._apiVersionConstraint ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiVersionConstraint()); set { {_apiVersionConstraint = value;} } } + + /// Internal Acessors for CreatedAtUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.CreatedAtUtc { get => this._createdAtUtc; set { {_createdAtUtc = value;} } } + + /// Internal Acessors for DeveloperPortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.DeveloperPortalUrl { get => this._developerPortalUrl; set { {_developerPortalUrl = value;} } } + + /// Internal Acessors for GatewayRegionalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.GatewayRegionalUrl { get => this._gatewayRegionalUrl; set { {_gatewayRegionalUrl = value;} } } + + /// Internal Acessors for GatewayUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.GatewayUrl { get => this._gatewayUrl; set { {_gatewayUrl = value;} } } + + /// Internal Acessors for ManagementApiUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.ManagementApiUrl { get => this._managementApiUrl; set { {_managementApiUrl = value;} } } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal.PlatformVersion { get => this._platformVersion; set { {_platformVersion = value;} } } + + /// Internal Acessors for PortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.PortalUrl { get => this._portalUrl; set { {_portalUrl = value;} } } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.PrivateIPAddress { get => this._privateIPAddress; set { {_privateIPAddress = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.PublicIPAddress { get => this._publicIPAddress; set { {_publicIPAddress = value;} } } + + /// Internal Acessors for ScmUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.ScmUrl { get => this._scmUrl; set { {_scmUrl = value;} } } + + /// Internal Acessors for TargetProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.TargetProvisioningState { get => this._targetProvisioningState; set { {_targetProvisioningState = value;} } } + + /// Internal Acessors for VirtualNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfiguration { get => (this._virtualNetworkConfiguration = this._virtualNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.VirtualNetworkConfiguration()); set { {_virtualNetworkConfiguration = value;} } } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Subnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Subnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Vnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get => (this._virtualNetworkConfiguration = this._virtualNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).SubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IAdditionalLocation) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateConfiguration[] Certificate { 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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ [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 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384", + SerializedName = @"customProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { 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.Api20220801.IHostnameConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHostnameConfiguration[] HostnameConfiguration { 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.Api20220801.IRemotePrivateEndpointConnectionWrapper) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAdditionalLocation[] AdditionalLocation { get; set; } + /// Control Plane Apis version constraint for the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration[] Certificate { 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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { 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.Api20220801.IHostnameConfiguration[] HostnameConfiguration { 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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceBaseProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBaseProperties.json.cs new file mode 100644 index 000000000000..8cb442aff38c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBaseProperties.json.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.Api20220801 +{ + 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; + } + {_virtualNetworkConfiguration = If( json?.PropertyT("virtualNetworkConfiguration"), out var __jsonVirtualNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.VirtualNetworkConfiguration.FromJson(__jsonVirtualNetworkConfiguration) : VirtualNetworkConfiguration;} + {_apiVersionConstraint = If( json?.PropertyT("apiVersionConstraint"), out var __jsonApiVersionConstraint) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHostnameConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAdditionalLocation) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.AdditionalLocation.FromJson(__f) )) ))() : null : AdditionalLocation;} + {_customProperty = If( json?.PropertyT("customProperties"), out var __jsonCustomProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRemotePrivateEndpointConnectionWrapper) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.RemotePrivateEndpointConnectionWrapper.FromJson(___q) )) ))() : null : PrivateEndpointConnection;} + {_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.Api20220801.IApiManagementServiceBaseProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBaseProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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._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 ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBasePropertiesCustomProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBasePropertiesCustomProperties.cs new file mode 100644 index 000000000000..0d29081a0964 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ public partial class ApiManagementServiceBasePropertiesCustomProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + 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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + internal partial interface IApiManagementServiceBasePropertiesCustomPropertiesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBasePropertiesCustomProperties.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBasePropertiesCustomProperties.dictionary.cs new file mode 100644 index 000000000000..9a841359db7e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApiManagementServiceBasePropertiesCustomProperties source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBasePropertiesCustomProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceBasePropertiesCustomProperties.json.cs new file mode 100644 index 000000000000..ba7c47adc374 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ 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.Api20220801.IApiManagementServiceBasePropertiesCustomProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceCheckNameAvailabilityParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceCheckNameAvailabilityParameters.cs new file mode 100644 index 000000000000..20a1f34e62bb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceCheckNameAvailabilityParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceCheckNameAvailabilityParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceCheckNameAvailabilityParameters.json.cs new file mode 100644 index 000000000000..7df51e1b44af --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceCheckNameAvailabilityParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceCheckNameAvailabilityParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceGetDomainOwnershipIdentifierResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceGetDomainOwnershipIdentifierResult.cs new file mode 100644 index 000000000000..4afbc1d64c2f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Response of the GetDomainOwnershipIdentifier operation. + public partial class ApiManagementServiceGetDomainOwnershipIdentifierResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceGetDomainOwnershipIdentifierResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceGetDomainOwnershipIdentifierResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceGetDomainOwnershipIdentifierResult.json.cs new file mode 100644 index 000000000000..c266e0b6344a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceGetDomainOwnershipIdentifierResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceGetDomainOwnershipIdentifierResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceGetSsoTokenResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceGetSsoTokenResult.cs new file mode 100644 index 000000000000..bd70f7340f6a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceGetSsoTokenResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceGetSsoTokenResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceGetSsoTokenResult.json.cs new file mode 100644 index 000000000000..d581959595c3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceGetSsoTokenResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceGetSsoTokenResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceIdentity.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceIdentity.cs new file mode 100644 index 000000000000..97ecfe9ba333 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal + { + + /// Internal Acessors for PrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceIdentity.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceIdentity.json.cs new file mode 100644 index 000000000000..0a4e5b077895 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApiManagementServiceIdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : UserAssignedIdentity;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceIdentityUserAssignedIdentities.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceIdentityUserAssignedIdentities.cs new file mode 100644 index 000000000000..7b0f87a3c93f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceIdentityUserAssignedIdentities.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceIdentityUserAssignedIdentities.dictionary.cs new file mode 100644 index 000000000000..239898ddd7df --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.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.Api20220801.IUserIdentityProperties value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceIdentityUserAssignedIdentities source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceIdentityUserAssignedIdentities.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceIdentityUserAssignedIdentities.json.cs new file mode 100644 index 000000000000..697e46c799e1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.UserIdentityProperties.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceListResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceListResult.cs new file mode 100644 index 000000000000..0d3ed9504082 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceListResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceResource) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceListResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceListResult.json.cs new file mode 100644 index 000000000000..145a52fae8c1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceResource) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceNameAvailabilityResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceNameAvailabilityResult.cs new file mode 100644 index 000000000000..10e855d6d0c6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Response of the CheckNameAvailability operation. + public partial class ApiManagementServiceNameAvailabilityResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceNameAvailabilityResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceNameAvailabilityResultInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for NameAvailable + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceNameAvailabilityResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceNameAvailabilityResult.json.cs new file mode 100644 index 000000000000..5a09ce25826a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceNameAvailabilityResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceNameAvailabilityResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceProperties.cs new file mode 100644 index 000000000000..61402380f953 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceProperties.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + 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.Api20220801.IApiManagementServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServicePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBaseProperties __apiManagementServiceBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAdditionalLocation[] AdditionalLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).AdditionalLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionConstraint ApiVersionConstraint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraintMinApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration[] Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Certificate = value ?? null /* arrayOf */; } + + /// + /// 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.Api20220801.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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CustomProperty = value ?? null /* model class */; } + + /// 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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DisableGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).EnableClientCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IHostnameConfiguration[] HostnameConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).HostnameConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).HostnameConfiguration = value ?? null /* arrayOf */; } + + /// 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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl; } + + /// Internal Acessors for CreatedAtUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CreatedAtUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CreatedAtUtc = value; } + + /// Internal Acessors for DeveloperPortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalUrl = value; } + + /// Internal Acessors for GatewayRegionalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayRegionalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayRegionalUrl = value; } + + /// Internal Acessors for GatewayUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayUrl = value; } + + /// Internal Acessors for ManagementApiUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl = value; } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).OutboundPublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).OutboundPublicIPAddress = value; } + + /// Internal Acessors for PlatformVersion + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PlatformVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PlatformVersion = value; } + + /// Internal Acessors for PortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PortalUrl = value; } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateIPAddress = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ProvisioningState = value; } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddress = value; } + + /// Internal Acessors for ScmUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ScmUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ScmUrl = value; } + + /// Internal Acessors for TargetProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).TargetProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).TargetProvisioningState = value; } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationVnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NatGatewayState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NotificationSenderEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddressId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Restore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal + { + /// Publisher email. + string PublisherEmail { get; set; } + /// Publisher name. + string PublisherName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceProperties.json.cs new file mode 100644 index 000000000000..8a979fcea1f4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IApiManagementServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceResource.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceResource.cs new file mode 100644 index 000000000000..690bccbe8732 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceResource.cs @@ -0,0 +1,1073 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + 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.Api20220801.IApiManagementServiceResource, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResource __apimResource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAdditionalLocation[] AdditionalLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).AdditionalLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraintMinApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration[] Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).Certificate = value ?? null /* arrayOf */; } + + /// + /// 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.Api20220801.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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).CustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).CustomProperty = value ?? null /* model class */; } + + /// 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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).DisableGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).EnableClientCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IHostnameConfiguration[] HostnameConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).HostnameConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApimResourceInternal)__apimResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// 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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl; } + + /// Internal Acessors for ApiVersionConstraint + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionConstraint Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.ApiVersionConstraint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraint = value; } + + /// Internal Acessors for CreatedAtUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).CreatedAtUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).CreatedAtUtc = value; } + + /// Internal Acessors for DeveloperPortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalUrl = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for GatewayRegionalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).GatewayRegionalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).GatewayRegionalUrl = value; } + + /// Internal Acessors for GatewayUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).GatewayUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).GatewayUrl = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for ManagementApiUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl = value; } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).OutboundPublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).OutboundPublicIPAddress = value; } + + /// Internal Acessors for PlatformVersion + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PlatformVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PlatformVersion = value; } + + /// Internal Acessors for PortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PortalUrl = value; } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddress = value; } + + /// Internal Acessors for ScmUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceSkuProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceSkuProperties()); set { {_sku = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceResourceInternal.TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).TargetProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).TargetProvisioningState = value; } + + /// Internal Acessors for VirtualNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.VirtualNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfiguration = value; } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResourceInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationVnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationVnetid = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).NatGatewayState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).NotificationSenderEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddressId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServicePropertiesInternal)Property).PublisherEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServicePropertiesInternal)Property).PublisherName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).Restore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceSkuProperties Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceSkuPropertiesInternal)Sku).Capacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceSkuPropertiesInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApimResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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() + { + + } + + /// 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.Api20220801.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.Api20220801.IAdditionalLocation) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateConfiguration[] Certificate { 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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ [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 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384", + SerializedName = @"customProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { 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.Api20220801.IHostnameConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { 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.Api20220801.IRemotePrivateEndpointConnectionWrapper) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApimResourceInternal + { + /// Additional datacenter locations of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAdditionalLocation[] AdditionalLocation { get; set; } + /// Control Plane Apis version constraint for the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration[] Certificate { 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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { 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.Api20220801.IHostnameConfiguration[] HostnameConfiguration { get; set; } + /// Managed service identity of the Api Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { 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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceResource.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceResource.json.cs new file mode 100644 index 000000000000..f4dc110c0774 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApimResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceProperties.FromJson(__jsonProperties) : Property;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceSkuProperties.FromJson(__jsonSku) : Sku;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceSkuProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceSkuProperties.cs new file mode 100644 index 000000000000..52ceb09bec71 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceSkuProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceSkuProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceSkuProperties.json.cs new file mode 100644 index 000000000000..0166ba602003 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementServiceSkuProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceSkuProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceUpdateParameters.cs new file mode 100644 index 000000000000..6f42fe42312e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceUpdateParameters.cs @@ -0,0 +1,960 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + 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.Api20220801.IApiManagementServiceUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResource __apimResource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAdditionalLocation[] AdditionalLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).AdditionalLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraintMinApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration[] Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).Certificate = value ?? null /* arrayOf */; } + + /// + /// 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.Api20220801.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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).CustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).CustomProperty = value ?? null /* model class */; } + + /// 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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).DisableGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).EnableClientCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IHostnameConfiguration[] HostnameConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).HostnameConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApimResourceInternal)__apimResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// 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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl; } + + /// Internal Acessors for ApiVersionConstraint + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionConstraint Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.ApiVersionConstraint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraint = value; } + + /// Internal Acessors for CreatedAtUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).CreatedAtUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).CreatedAtUtc = value; } + + /// Internal Acessors for DeveloperPortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalUrl = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for GatewayRegionalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).GatewayRegionalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).GatewayRegionalUrl = value; } + + /// Internal Acessors for GatewayUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).GatewayUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).GatewayUrl = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for ManagementApiUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl = value; } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).OutboundPublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).OutboundPublicIPAddress = value; } + + /// Internal Acessors for PlatformVersion + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PlatformVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PlatformVersion = value; } + + /// Internal Acessors for PortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PortalUrl = value; } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceUpdateProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddress = value; } + + /// Internal Acessors for ScmUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceSkuProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceSkuProperties()); set { {_sku = value;} } } + + /// Internal Acessors for TargetProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).TargetProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).TargetProvisioningState = value; } + + /// Internal Acessors for VirtualNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.VirtualNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfiguration = value; } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParametersInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationVnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationVnetid = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).NatGatewayState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).NotificationSenderEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddressId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceUpdatePropertiesInternal)Property).PublisherEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceUpdatePropertiesInternal)Property).PublisherName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).Restore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceSkuProperties Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceSkuPropertiesInternal)Sku).Capacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceSkuPropertiesInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApimResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal)__apimResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IAdditionalLocation) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateConfiguration[] Certificate { 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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ [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 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384", + SerializedName = @"customProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { 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.Api20220801.IHostnameConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { 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.Api20220801.IRemotePrivateEndpointConnectionWrapper) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApimResourceInternal + { + /// Additional datacenter locations of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAdditionalLocation[] AdditionalLocation { get; set; } + /// Control Plane Apis version constraint for the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration[] Certificate { 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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { 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.Api20220801.IHostnameConfiguration[] HostnameConfiguration { get; set; } + /// Managed service identity of the Api Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { 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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceUpdateParameters.json.cs new file mode 100644 index 000000000000..c32d0fdf7e40 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApimResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceUpdateProperties.FromJson(__jsonProperties) : Property;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementServiceSkuProperties.FromJson(__jsonSku) : Sku;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementServiceUpdateProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceUpdateProperties.cs new file mode 100644 index 000000000000..3e6ecf7e1ae6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceUpdateProperties.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + 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.Api20220801.IApiManagementServiceUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdatePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBaseProperties __apiManagementServiceBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAdditionalLocation[] AdditionalLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).AdditionalLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionConstraint ApiVersionConstraint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraintMinApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateConfiguration[] Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Certificate = value ?? null /* arrayOf */; } + + /// + /// 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.Api20220801.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 1st 2018 and `False` otherwise. Http2 setting's default value + /// is `False`.

You can disable any of next 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: next ciphers can't be disabled since they are required by Azure CloudService + /// internal components: 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,TLS_RSA_WITH_AES_256_GCM_SHA384 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CustomProperty = value ?? null /* model class */; } + + /// 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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DisableGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).EnableClientCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IHostnameConfiguration[] HostnameConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).HostnameConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).HostnameConfiguration = value ?? null /* arrayOf */; } + + /// 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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl; } + + /// Internal Acessors for CreatedAtUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CreatedAtUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CreatedAtUtc = value; } + + /// Internal Acessors for DeveloperPortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalUrl = value; } + + /// Internal Acessors for GatewayRegionalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayRegionalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayRegionalUrl = value; } + + /// Internal Acessors for GatewayUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayUrl = value; } + + /// Internal Acessors for ManagementApiUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl = value; } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).OutboundPublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).OutboundPublicIPAddress = value; } + + /// Internal Acessors for PlatformVersion + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PlatformVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PlatformVersion = value; } + + /// Internal Acessors for PortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PortalUrl = value; } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateIPAddress = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ProvisioningState = value; } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddress = value; } + + /// Internal Acessors for ScmUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ScmUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ScmUrl = value; } + + /// Internal Acessors for TargetProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).TargetProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).TargetProvisioningState = value; } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationVnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NatGatewayState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NotificationSenderEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddressId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Restore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiManagementServiceBasePropertiesInternal + { + /// Publisher email. + string PublisherEmail { get; set; } + /// Publisher name. + string PublisherName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceUpdateProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementServiceUpdateProperties.json.cs new file mode 100644 index 000000000000..53fd2bcdfd12 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IApiManagementServiceUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementServiceUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSku.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSku.cs new file mode 100644 index 000000000000..ea7921b7dc18 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes an available ApiManagement SKU. + public partial class ApiManagementSku : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSku, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiManagementSkuCapabilities[] Capability { get => this._capability; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuCapacity Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementSkuCapacityInternal)Capacity).ScaleType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementSkuLocationInfo[] LocationInfo { get => this._locationInfo; } + + /// Internal Acessors for ApiVersion + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.ApiVersion { get => this._apiVersion; set { {_apiVersion = value;} } } + + /// Internal Acessors for Capability + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapabilities[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.Capability { get => this._capability; set { {_capability = value;} } } + + /// Internal Acessors for Capacity + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapacity Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementSkuCapacity()); set { {_capacity = value;} } } + + /// Internal Acessors for CapacityDefault + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.CapacityDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapacityInternal)Capacity).Default; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapacityInternal)Capacity).Default = value; } + + /// Internal Acessors for CapacityMaximum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.CapacityMaximum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapacityInternal)Capacity).Maximum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapacityInternal)Capacity).Maximum = value; } + + /// Internal Acessors for CapacityMinimum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.CapacityMinimum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapacityInternal)Capacity).Minimum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapacityInternal)Capacity).Minimum = value; } + + /// Internal Acessors for CapacityScaleType + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.CapacityScaleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapacityInternal)Capacity).ScaleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapacityInternal)Capacity).ScaleType = value; } + + /// Internal Acessors for Cost + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCosts[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.Cost { get => this._cost; set { {_cost = value;} } } + + /// Internal Acessors for Family + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.Family { get => this._family; set { {_family = value;} } } + + /// Internal Acessors for Kind + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for Location + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for LocationInfo + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuLocationInfo[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.LocationInfo { get => this._locationInfo; set { {_locationInfo = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } + + /// Internal Acessors for Restriction + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictions[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.Restriction { get => this._restriction; set { {_restriction = value;} } } + + /// Internal Acessors for Size + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuInternal.Size { get => this._size; set { {_size = value;} } } + + /// Internal Acessors for Tier + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementSkuCapabilities) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuCosts) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuLocationInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuRestrictions) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuCapabilities[] Capability { get; set; } + /// Specifies the number of virtual machines in the scale set. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSku.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSku.json.cs new file mode 100644 index 000000000000..934f5d9eb944 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IApiManagementSkuLocationInfo) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuCosts) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuCapabilities) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuRestrictions) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementSkuRestrictions.FromJson(___v) )) ))() : null : Restriction;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuCapabilities.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuCapabilities.cs new file mode 100644 index 000000000000..517c5b8f6d4c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes The SKU capabilities object. + public partial class ApiManagementSkuCapabilities : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapabilities, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapabilitiesInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapabilitiesInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuCapabilities.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuCapabilities.json.cs new file mode 100644 index 000000000000..7c253543960b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSkuCapabilities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapabilities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuCapacity.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuCapacity.cs new file mode 100644 index 000000000000..58faf106601a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSkuCapacity, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuCapacityInternal.Default { get => this._default; set { {_default = value;} } } + + /// Internal Acessors for Maximum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapacityInternal.Maximum { get => this._maximum; set { {_maximum = value;} } } + + /// Internal Acessors for Minimum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuCapacity.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuCapacity.json.cs new file mode 100644 index 000000000000..136cc7818953 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSkuCapacity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapacity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuCosts.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuCosts.cs new file mode 100644 index 000000000000..b3a5ecb0aea6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSkuCosts, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuCostsInternal.ExtendedUnit { get => this._extendedUnit; set { {_extendedUnit = value;} } } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCostsInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for Quantity + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuCosts.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuCosts.json.cs new file mode 100644 index 000000000000..071aae35c404 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSkuCosts. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCosts. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuLocationInfo.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuLocationInfo.cs new file mode 100644 index 000000000000..f391fad134fa --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementSkuLocationInfo : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuLocationInfo, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuLocationInfoInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for Zone + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuLocationInfoInternal.Zone { get => this._zone; set { {_zone = value;} } } + + /// Internal Acessors for ZoneDetail + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuZoneDetails[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementSkuZoneDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuZoneDetails[] ZoneDetail { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuLocationInfo.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuLocationInfo.json.cs new file mode 100644 index 000000000000..83f2edddeeb0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSkuZoneDetails) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementSkuZoneDetails.FromJson(__p) )) ))() : null : ZoneDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuLocationInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuLocationInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuRestrictionInfo.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuRestrictionInfo.cs new file mode 100644 index 000000000000..298bbe6b6545 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementSkuRestrictionInfo : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionInfo, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuRestrictionInfoInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for Zone + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuRestrictionInfo.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuRestrictionInfo.json.cs new file mode 100644 index 000000000000..18def55e2b2d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSkuRestrictionInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuRestrictions.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuRestrictions.cs new file mode 100644 index 000000000000..2da53346c307 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSkuRestrictions, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionsInternal + { + + /// Internal Acessors for ReasonCode + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionsInternal.ReasonCode { get => this._reasonCode; set { {_reasonCode = value;} } } + + /// Internal Acessors for RestrictionInfo + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionInfo Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionsInternal.RestrictionInfo { get => (this._restrictionInfo = this._restrictionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementSkuRestrictionInfo()); set { {_restrictionInfo = value;} } } + + /// Internal Acessors for RestrictionInfoLocation + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionsInternal.RestrictionInfoLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionInfoInternal)RestrictionInfo).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionInfoInternal)RestrictionInfo).Location = value; } + + /// Internal Acessors for RestrictionInfoZone + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionsInternal.RestrictionInfoZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionInfoInternal)RestrictionInfo).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionInfoInternal)RestrictionInfo).Zone = value; } + + /// Internal Acessors for Type + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictionsInternal.Type { get => this._type; set { {_type = value;} } } + + /// Internal Acessors for Value + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiManagementSkuRestrictionInfo RestrictionInfo { get => (this._restrictionInfo = this._restrictionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuRestrictions.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuRestrictions.json.cs new file mode 100644 index 000000000000..28df29fc3a0e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IApiManagementSkuRestrictions. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuRestrictions. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuZoneDetails.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuZoneDetails.cs new file mode 100644 index 000000000000..1c8ddfa96091 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSkuZoneDetails, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuZoneDetailsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuCapabilities[] Capability { get => this._capability; } + + /// Internal Acessors for Capability + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuCapabilities[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuZoneDetailsInternal.Capability { get => this._capability; set { {_capability = value;} } } + + /// Internal Acessors for Name + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkuCapabilities) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkuZoneDetails.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkuZoneDetails.json.cs new file mode 100644 index 000000000000..b54ae98e57de --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSkuCapabilities) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiManagementSkuCapabilities.FromJson(__p) )) ))() : null : Capability;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuZoneDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkuZoneDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiManagementSkusResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkusResult.cs new file mode 100644 index 000000000000..54814f01359d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSkusResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkusResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IApiManagementSku) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSku[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkusResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiManagementSkusResult.json.cs new file mode 100644 index 000000000000..785ef4dd1ccb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiManagementSku) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiManagementSkusResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiManagementSkusResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiReleaseCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiReleaseCollection.cs new file mode 100644 index 000000000000..9366c41124f0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged ApiRelease list representation. + public partial class ApiReleaseCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiReleaseCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiReleaseContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiReleaseContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiReleaseContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiReleaseCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiReleaseCollection.json.cs new file mode 100644 index 000000000000..43f08f9ee712 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiReleaseContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiReleaseCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiReleaseContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiReleaseContract.cs new file mode 100644 index 000000000000..08d3a1112b88 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// ApiRelease details. + public partial class ApiReleaseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiReleaseContractPropertiesInternal)Property).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiReleaseContractInternal.CreatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContractPropertiesInternal)Property).CreatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContractPropertiesInternal)Property).CreatedDateTime = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiReleaseContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for UpdatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContractInternal.UpdatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContractPropertiesInternal)Property).UpdatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiReleaseContractPropertiesInternal)Property).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContractPropertiesInternal)Property).Note = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiReleaseContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiReleaseContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiReleaseContract.json.cs new file mode 100644 index 000000000000..a55696556eda --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApiReleaseContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiReleaseContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiReleaseContractProperties.cs new file mode 100644 index 000000000000..dd215b17ad34 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Release details + public partial class ApiReleaseContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiReleaseContractPropertiesInternal.CreatedDateTime { get => this._createdDateTime; set { {_createdDateTime = value;} } } + + /// Internal Acessors for UpdatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiReleaseContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiReleaseContractProperties.json.cs new file mode 100644 index 000000000000..bbda483e1519 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiReleaseContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiReleaseContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiRevisionCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiRevisionCollection.cs new file mode 100644 index 000000000000..f336412c4b7e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged API Revision list representation. + public partial class ApiRevisionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiRevisionCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiRevisionContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiRevisionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiRevisionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiRevisionCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiRevisionCollection.json.cs new file mode 100644 index 000000000000..30451d5c47fa --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiRevisionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiRevisionCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiRevisionContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiRevisionContract.cs new file mode 100644 index 000000000000..f8449aaabc20 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Summary of revision metadata. + public partial class ApiRevisionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiRevisionContractInternal.ApiId { get => this._apiId; set { {_apiId = value;} } } + + /// Internal Acessors for ApiRevision + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionContractInternal.ApiRevision { get => this._apiRevision; set { {_apiRevision = value;} } } + + /// Internal Acessors for CreatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionContractInternal.CreatedDateTime { get => this._createdDateTime; set { {_createdDateTime = value;} } } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionContractInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for IsCurrent + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionContractInternal.IsCurrent { get => this._isCurrent; set { {_isCurrent = value;} } } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionContractInternal.IsOnline { get => this._isOnline; set { {_isOnline = value;} } } + + /// Internal Acessors for PrivateUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionContractInternal.PrivateUrl { get => this._privateUrl; set { {_privateUrl = value;} } } + + /// Internal Acessors for UpdatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiRevisionContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiRevisionContract.json.cs new file mode 100644 index 000000000000..4c1a474c62d3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiRevisionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiRevisionInfoContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiRevisionInfoContract.cs new file mode 100644 index 000000000000..7165fa5b562f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiRevisionInfoContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiVersionSetContractDetails ApiVersionSet { get => (this._apiVersionSet = this._apiVersionSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersioningScheme = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme)""); } + + /// Internal Acessors for ApiVersionSet + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContractDetails Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionInfoContractInternal.ApiVersionSet { get => (this._apiVersionSet = this._apiVersionSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiRevisionInfoContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiRevisionInfoContract.json.cs new file mode 100644 index 000000000000..16a264d29aeb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IApiRevisionInfoContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiRevisionInfoContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiTagResourceContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiTagResourceContractProperties.cs new file mode 100644 index 000000000000..9acef3d900da --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiTagResourceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiTagResourceContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContract __apiEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthenticationSettingsContract AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContactInformation Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiLicenseInformation License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl = value ?? null; } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)__apiEntityBaseContract).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiTagResourceContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiTagResourceContractProperties.json.cs new file mode 100644 index 000000000000..aa23d882974c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IApiTagResourceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiTagResourceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiUpdateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiUpdateContract.cs new file mode 100644 index 000000000000..ff9a7b101bfa --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API update contract details. + public partial class ApiUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractUpdatePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).LicenseUrl = value ?? null; } + + /// Internal Acessors for AuthenticationSetting + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiUpdateContractInternal.AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSetting = value; } + + /// Internal Acessors for AuthenticationSettingOAuth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiUpdateContractInternal.AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2 = value; } + + /// Internal Acessors for AuthenticationSettingOpenid + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiUpdateContractInternal.AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid = value; } + + /// Internal Acessors for Contact + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContactInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiUpdateContractInternal.Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).Contact = value; } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiUpdateContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).IsOnline = value; } + + /// Internal Acessors for License + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiLicenseInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiUpdateContractInternal.License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).License = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiContractUpdateProperties()); set { {_property = value;} } } + + /// Internal Acessors for SubscriptionKeyParameterName + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionKeyParameterNamesContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiUpdateContractInternal.SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractUpdatePropertiesInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiContractUpdatePropertiesInternal)Property).Path = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractUpdatePropertiesInternal)Property).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiContractUpdatePropertiesInternal)Property).ServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiEntityBaseContractInternal)Property).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthenticationSettingsContract AuthenticationSetting { get; set; } + /// OAuth2 Authentication settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// OpenID Connect Authentication Settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + /// Contact information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiUpdateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiUpdateContract.json.cs new file mode 100644 index 000000000000..eb96afe4a3ea --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApiContractUpdateProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiVersionConstraint.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionConstraint.cs new file mode 100644 index 000000000000..aa81c55c4038 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiVersionConstraint, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiVersionConstraint.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionConstraint.json.cs new file mode 100644 index 000000000000..4be7fef90b54 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiVersionConstraint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionConstraint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetCollection.cs new file mode 100644 index 000000000000..61fb5e864d2b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiVersionSetCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetCollection.json.cs new file mode 100644 index 000000000000..d890a7fdf316 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiVersionSetContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetContract.cs new file mode 100644 index 000000000000..29e689a7fa80 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Version Set Contract details. + public partial class ApiVersionSetContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IApiVersionSetContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)Property).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)Property).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetContractPropertiesInternal)Property).VersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetContract.json.cs new file mode 100644 index 000000000000..b84dfecd0a28 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApiVersionSetContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetContractDetails.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetContractDetails.cs new file mode 100644 index 000000000000..b8c0b3f9cc30 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiVersionSetContractDetails, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetContractDetails.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetContractDetails.json.cs new file mode 100644 index 000000000000..039501b26670 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiVersionSetContractDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContractDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetContractProperties.cs new file mode 100644 index 000000000000..10efbd07ae98 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiVersionSetContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetEntityBase __apiVersionSetEntityBase = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetContractProperties.json.cs new file mode 100644 index 000000000000..e97c6bdb035a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IApiVersionSetContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetEntityBase.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetEntityBase.cs new file mode 100644 index 000000000000..d045f644d685 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Version set base parameters + public partial class ApiVersionSetEntityBase : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetEntityBase, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetEntityBase.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetEntityBase.json.cs new file mode 100644 index 000000000000..1203b2b6d042 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiVersionSetEntityBase. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetEntityBase. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetUpdateParameters.cs new file mode 100644 index 000000000000..8815aa867a43 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiVersionSetUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetUpdateParametersPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetUpdateParametersPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetUpdateParametersProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiVersionSetUpdateParametersProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetUpdateParametersProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)Property).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)Property).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetUpdateParametersPropertiesInternal)Property).VersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetUpdateParameters.json.cs new file mode 100644 index 000000000000..115c184642c2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApiVersionSetUpdateParametersProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetUpdateParametersProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetUpdateParametersProperties.cs new file mode 100644 index 000000000000..783cf78a2386 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApiVersionSetUpdateParametersProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetUpdateParametersPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetEntityBase __apiVersionSetEntityBase = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApiVersionSetUpdateParametersProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApiVersionSetUpdateParametersProperties.json.cs new file mode 100644 index 000000000000..1e6e4ddbacf0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IApiVersionSetUpdateParametersProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApiVersionSetUpdateParametersProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApimResource.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApimResource.cs new file mode 100644 index 000000000000..910b0354f3a0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The Resource definition. + public partial class ApimResource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResource, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApimResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApimResourceTags _tag; + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApimResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ApimResource.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApimResource.json.cs new file mode 100644 index 000000000000..e776a9258ad5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApimResourceTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApimResourceTags.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApimResourceTags.cs new file mode 100644 index 000000000000..a307d09e84cd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resource tags. + public partial class ApimResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ApimResourceTags.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApimResourceTags.dictionary.cs new file mode 100644 index 000000000000..7514f6874991 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ApimResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ApimResourceTags.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ApimResourceTags.json.cs new file mode 100644 index 000000000000..ba467f2d07cb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IApimResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IApimResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ArmIdWrapper.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ArmIdWrapper.cs new file mode 100644 index 000000000000..73ab131a82e6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IArmIdWrapper, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ArmIdWrapper.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ArmIdWrapper.json.cs new file mode 100644 index 000000000000..07813dda4872 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IArmIdWrapper. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IArmIdWrapper. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AssociationContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AssociationContract.cs new file mode 100644 index 000000000000..4b3bf0940680 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Association entity details. + public partial class AssociationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAssociationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAssociationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAssociationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IAssociationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAssociationContractPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/AssociationContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AssociationContract.json.cs new file mode 100644 index 000000000000..a109d8fd1be4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AssociationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAssociationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAssociationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AssociationContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AssociationContractProperties.cs new file mode 100644 index 000000000000..edc8fe77f4ec --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Association entity contract properties. + public partial class AssociationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAssociationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AssociationContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AssociationContractProperties.json.cs new file mode 100644 index 000000000000..4fc94a3a1c3b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAssociationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAssociationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthenticationSettingsContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthenticationSettingsContract.cs new file mode 100644 index 000000000000..6c44832c5625 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Authentication Settings. + public partial class AuthenticationSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContractInternal + { + + /// Internal Acessors for OAuth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContractInternal.OAuth2 { get => (this._oAuth2 = this._oAuth2 ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.OAuth2AuthenticationSettingsContract()); set { {_oAuth2 = value;} } } + + /// Internal Acessors for Openid + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContractInternal.Openid { get => (this._openid = this._openid ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.OpenIdAuthenticationSettingsContract()); set { {_openid = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract OAuth2 { get => (this._oAuth2 = this._oAuth2 ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.OAuth2AuthenticationSettingsContract()); set => this._oAuth2 = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContractInternal)OAuth2).AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContractInternal)OAuth2).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContractInternal)OAuth2).Scope = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract Openid { get => (this._openid = this._openid ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.OpenIdAuthenticationSettingsContract()); set => this._openid = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContractInternal)Openid).BearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContractInternal)Openid).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract OAuth2 { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract Openid { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthenticationSettingsContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthenticationSettingsContract.json.cs new file mode 100644 index 000000000000..be976aa8bd8d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.OAuth2AuthenticationSettingsContract.FromJson(__jsonOAuth2) : OAuth2;} + {_openid = If( json?.PropertyT("openid"), out var __jsonOpenid) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOAuth2AuthenticationSettingsContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenIdAuthenticationSettingsContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.OpenIdAuthenticationSettingsContract.FromJson(__p) )) ))() : null : OpenidAuthenticationSetting;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthenticationSettingsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationAccessPolicyCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyCollection.cs new file mode 100644 index 000000000000..9f0d33c55f39 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationAccessPolicyCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationAccessPolicyContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationAccessPolicyContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationAccessPolicyContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyCollection.json.cs new file mode 100644 index 000000000000..080426cde41c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationAccessPolicyContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationAccessPolicyCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationAccessPolicyCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationAccessPolicyContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyContract.cs new file mode 100644 index 000000000000..58cf23a309ed --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyContract.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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization access policy contract. + public partial class AuthorizationAccessPolicyContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationAccessPolicyContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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(); + + /// 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.Api20220801.IAuthorizationAccessPolicyContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationAccessPolicyContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationAccessPolicyContractPropertiesInternal)Property).ObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationAccessPolicyContractPropertiesInternal)Property).ObjectId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationAccessPolicyContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationAccessPolicyContractPropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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 + { + [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 + { + string ETag { get; set; } + /// The Object Id + string ObjectId { get; set; } + /// Properties of the Authorization Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationAccessPolicyContractProperties Property { get; set; } + /// The Tenant Id + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyContract.json.cs new file mode 100644 index 000000000000..73e8b8d8dd28 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AuthorizationAccessPolicyContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationAccessPolicyContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationAccessPolicyContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationAccessPolicyContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyContractProperties.cs new file mode 100644 index 000000000000..43ebdefc7772 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyContractProperties.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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization Access Policy details. + public partial class AuthorizationAccessPolicyContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationAccessPolicyContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationAccessPolicyContractPropertiesInternal + { + + /// 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 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 Object Id + string ObjectId { get; set; } + /// The Tenant Id + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyContractProperties.json.cs new file mode 100644 index 000000000000..387787ea7cf4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationAccessPolicyContractProperties.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.Api20220801 +{ + 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; + } + {_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.Api20220801.IAuthorizationAccessPolicyContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationAccessPolicyContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; + } + 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/generated/api/Models/Api20220801/AuthorizationCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationCollection.cs new file mode 100644 index 000000000000..2979fbce8c64 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Authorization list representation. + public partial class AuthorizationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationCollection.json.cs new file mode 100644 index 000000000000..e242acabd009 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationConfirmConsentCodeRequestContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationConfirmConsentCodeRequestContract.cs new file mode 100644 index 000000000000..b2bfdd09218f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationConfirmConsentCodeRequestContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationConfirmConsentCodeRequestContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationConfirmConsentCodeRequestContract.json.cs new file mode 100644 index 000000000000..2f6842acad9e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationConfirmConsentCodeRequestContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationConfirmConsentCodeRequestContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationContract.cs new file mode 100644 index 000000000000..20aef79b2f27 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization contract. + public partial class AuthorizationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContractPropertiesInternal)Property).AuthorizationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContractPropertiesInternal)Property).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContractPropertiesInternal)Property).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationError Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractPropertiesInternal)Property).Error = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContractPropertiesInternal)Property).OAuth2GrantType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContractPropertiesParameters Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractPropertiesInternal)Property).Parameter = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContractPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IAuthorizationContractPropertiesParameters) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IAuthorizationContractPropertiesParameters Parameter { get; set; } + /// Properties of the Authorization Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractProperties Property { get; set; } + /// Status of the Authorization + string Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationContract.json.cs new file mode 100644 index 000000000000..3561cdbb0257 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AuthorizationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationContractProperties.cs new file mode 100644 index 000000000000..a8c132c922ec --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization details. + public partial class AuthorizationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationErrorInternal)Error).Code = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationErrorInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationError Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractPropertiesInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContractPropertiesParameters _parameter; + + /// Authorization parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractPropertiesParameters Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationContractPropertiesParameters) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IAuthorizationContractPropertiesParameters Parameter { get; set; } + /// Status of the Authorization + string Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationContractProperties.json.cs new file mode 100644 index 000000000000..d8d4d3a3e4d6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.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.Api20220801.IAuthorizationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationContractPropertiesParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationContractPropertiesParameters.cs new file mode 100644 index 000000000000..575145f97097 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization parameters + public partial class AuthorizationContractPropertiesParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractPropertiesParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationContractPropertiesParameters.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationContractPropertiesParameters.dictionary.cs new file mode 100644 index 000000000000..701d6ffad0c3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AuthorizationContractPropertiesParameters source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationContractPropertiesParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationContractPropertiesParameters.json.cs new file mode 100644 index 000000000000..9caee65dfd94 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationContractPropertiesParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationContractPropertiesParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationError.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationError.cs new file mode 100644 index 000000000000..1f0bfd66007c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization error details. + public partial class AuthorizationError : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationError, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationError.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationError.json.cs new file mode 100644 index 000000000000..c0597ec9b901 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationLoginRequestContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationLoginRequestContract.cs new file mode 100644 index 000000000000..3bb6f7f77bf7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization login request contract. + public partial class AuthorizationLoginRequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationLoginRequestContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationLoginRequestContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationLoginRequestContract.json.cs new file mode 100644 index 000000000000..73c51f26673d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationLoginRequestContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationLoginRequestContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationLoginResponseContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationLoginResponseContract.cs new file mode 100644 index 000000000000..0df614358c46 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization login response contract. + public partial class AuthorizationLoginResponseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationLoginResponseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/AuthorizationLoginResponseContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationLoginResponseContract.json.cs new file mode 100644 index 000000000000..e9f91ab22f2d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationLoginResponseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationLoginResponseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationProviderCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderCollection.cs new file mode 100644 index 000000000000..fd2fea694b37 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Authorization Provider list representation. + public partial class AuthorizationProviderCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderCollection.json.cs new file mode 100644 index 000000000000..9cd744a623b1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationProviderContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationProviderContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderContract.cs new file mode 100644 index 000000000000..e0f3cab74d28 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization Provider contract. + public partial class AuthorizationProviderContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractPropertiesInternal)Property).GrantTypeAuthorizationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractPropertiesInternal)Property).GrantTypeClientCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderContractPropertiesInternal)Property).IdentityProvider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2Settings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractInternal.Oauth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2 = value; } + + /// Internal Acessors for Oauth2GrantType + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypes Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractInternal.Oauth2GrantType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2GrantType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2GrantType = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2RedirectUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2RedirectUrl = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2Settings Oauth2 { get; set; } + /// OAuth2 settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderContract.json.cs new file mode 100644 index 000000000000..8697322ca5b0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AuthorizationProviderContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationProviderContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderContractProperties.cs new file mode 100644 index 000000000000..eb4548bb5958 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization Provider details. + public partial class AuthorizationProviderContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).GrantTypeAuthorizationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).GrantTypeClientCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2Settings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractPropertiesInternal.Oauth2 { get => (this._oauth2 = this._oauth2 ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.AuthorizationProviderOAuth2Settings()); set { {_oauth2 = value;} } } + + /// Internal Acessors for Oauth2GrantType + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypes Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractPropertiesInternal.Oauth2GrantType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).GrantType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).GrantType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2Settings _oauth2; + + /// OAuth2 settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2Settings Oauth2 { get => (this._oauth2 = this._oauth2 ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).RedirectUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2Settings Oauth2 { get; set; } + /// OAuth2 settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationProviderContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderContractProperties.json.cs new file mode 100644 index 000000000000..4ea8a080b914 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IAuthorizationProviderContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypes.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypes.cs new file mode 100644 index 000000000000..59f3ff3c871e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationProviderOAuth2GrantTypes, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode AuthorizationCode { get => (this._authorizationCode = this._authorizationCode ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.AuthorizationProviderOAuth2GrantTypesAuthorizationCode()); set => this._authorizationCode = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials ClientCredentials { get => (this._clientCredentials = this._clientCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode AuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials ClientCredentials { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypes.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypes.json.cs new file mode 100644 index 000000000000..f4aec89b127d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AuthorizationProviderOAuth2GrantTypesAuthorizationCode.FromJson(__jsonAuthorizationCode) : AuthorizationCode;} + {_clientCredentials = If( json?.PropertyT("clientCredentials"), out var __jsonClientCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.AuthorizationProviderOAuth2GrantTypesClientCredentials.FromJson(__jsonClientCredentials) : ClientCredentials;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypes. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypes. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.cs new file mode 100644 index 000000000000..b433507c7901 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth2 authorization code grant parameters + public partial class AuthorizationProviderOAuth2GrantTypesAuthorizationCode : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.dictionary.cs new file mode 100644 index 000000000000..5edf483ceb4e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AuthorizationProviderOAuth2GrantTypesAuthorizationCode source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.json.cs new file mode 100644 index 000000000000..d2a7b789a622 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesClientCredentials.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesClientCredentials.cs new file mode 100644 index 000000000000..596a2ea3852c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth2 client credential grant parameters + public partial class AuthorizationProviderOAuth2GrantTypesClientCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesClientCredentials.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesClientCredentials.dictionary.cs new file mode 100644 index 000000000000..21ad4e73125b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AuthorizationProviderOAuth2GrantTypesClientCredentials source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesClientCredentials.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2GrantTypesClientCredentials.json.cs new file mode 100644 index 000000000000..9720f1d3a7eb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationProviderOAuth2Settings.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2Settings.cs new file mode 100644 index 000000000000..559c53a5b20e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth2 settings details + public partial class AuthorizationProviderOAuth2Settings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2Settings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2SettingsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypes _grantType; + + /// OAuth2 settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypes GrantType { get => (this._grantType = this._grantType ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypesInternal)GrantType).AuthorizationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypesInternal)GrantType).ClientCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypesInternal)GrantType).ClientCredentials = value ?? null /* model class */; } + + /// Internal Acessors for GrantType + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypes Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2SettingsInternal.GrantType { get => (this._grantType = this._grantType ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypesClientCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2GrantTypes GrantType { get; set; } + /// OAuth2 authorization code grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationProviderOAuth2Settings.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationProviderOAuth2Settings.json.cs new file mode 100644 index 000000000000..afd019438801 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IAuthorizationProviderOAuth2Settings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationProviderOAuth2Settings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerCollection.cs new file mode 100644 index 000000000000..31a029c1a138 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationServerCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerCollection.json.cs new file mode 100644 index 000000000000..9b5b71c17f35 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationServerContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerContract.cs new file mode 100644 index 000000000000..d126c3928f6a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server settings. + public partial class AuthorizationServerContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractPropertiesInternal)Property).AuthorizationEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).AuthorizationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).BearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).ClientAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractPropertiesInternal)Property).ClientRegistrationEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).DefaultScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractPropertiesInternal)Property).GrantType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IAuthorizationServerContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).SupportState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITokenBodyParameterContract[] TokenBodyParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).TokenBodyParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).TokenEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractPropertiesInternal)Property).UseInApiDocumentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractPropertiesInternal)Property).UseInTestConsole; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ITokenBodyParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerContract.json.cs new file mode 100644 index 000000000000..beccd452ccfd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AuthorizationServerContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerContractBaseProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerContractBaseProperties.cs new file mode 100644 index 000000000000..65b412758504 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationServerContractBaseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.ITokenBodyParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerContractBaseProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerContractBaseProperties.json.cs new file mode 100644 index 000000000000..7769212850b1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITokenBodyParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBaseProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContractBaseProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerContractProperties.cs new file mode 100644 index 000000000000..bd04e5d7a96a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationServerContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContractBaseProperties __authorizationServerContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).AuthorizationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).BearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ClientAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).DefaultScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).SupportState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITokenBodyParameterContract[] TokenBodyParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenBodyParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerContractProperties.json.cs new file mode 100644 index 000000000000..d3d8c65d622d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IAuthorizationServerContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerSecretsContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerSecretsContract.cs new file mode 100644 index 000000000000..75162ef4b9f8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth Server Secrets Contract. + public partial class AuthorizationServerSecretsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerSecretsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerSecretsContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerSecretsContract.json.cs new file mode 100644 index 000000000000..b8be2388ca89 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationServerSecretsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerSecretsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerUpdateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerUpdateContract.cs new file mode 100644 index 000000000000..98168b873a1f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server settings. + public partial class AuthorizationServerUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerUpdateContractPropertiesInternal)Property).AuthorizationEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).AuthorizationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).BearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).ClientAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerUpdateContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerUpdateContractPropertiesInternal)Property).ClientRegistrationEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerUpdateContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).DefaultScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerUpdateContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerUpdateContractPropertiesInternal)Property).GrantType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerUpdateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IAuthorizationServerUpdateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).SupportState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITokenBodyParameterContract[] TokenBodyParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).TokenBodyParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)Property).TokenEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerUpdateContractPropertiesInternal)Property).UseInApiDocumentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerUpdateContractPropertiesInternal)Property).UseInTestConsole; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITokenBodyParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerUpdateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerUpdateContract.json.cs new file mode 100644 index 000000000000..f954baab6373 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.AuthorizationServerUpdateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerUpdateContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerUpdateContractProperties.cs new file mode 100644 index 000000000000..6393fa31e370 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IAuthorizationServerUpdateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerUpdateContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContractBaseProperties __authorizationServerContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).AuthorizationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).BearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ClientAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).DefaultScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).SupportState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITokenBodyParameterContract[] TokenBodyParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenBodyParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/AuthorizationServerUpdateContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/AuthorizationServerUpdateContractProperties.json.cs new file mode 100644 index 000000000000..71af85528cc8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IAuthorizationServerUpdateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IAuthorizationServerUpdateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendAuthorizationHeaderCredentials.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendAuthorizationHeaderCredentials.cs new file mode 100644 index 000000000000..65f5461ca3d2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization header information. + public partial class BackendAuthorizationHeaderCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendAuthorizationHeaderCredentials, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendAuthorizationHeaderCredentials.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendAuthorizationHeaderCredentials.json.cs new file mode 100644 index 000000000000..a136a847a874 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBackendAuthorizationHeaderCredentials. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendAuthorizationHeaderCredentials. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendBaseParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendBaseParameters.cs new file mode 100644 index 000000000000..a79c20fc5f7e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendBaseParameters.cs @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend entity base Parameter set. + public partial class BackendBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractInternal)Credentials).AuthorizationParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractInternal)Credentials).AuthorizationScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractInternal)Credentials).AuthorizationScheme = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContract Credentials { get => (this._credentials = this._credentials ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractInternal)Credentials).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractInternal)Credentials).CertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractHeader CredentialsHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractInternal)Credentials).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractQuery CredentialsQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractInternal)Credentials).Query; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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 Credentials + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal.Credentials { get => (this._credentials = this._credentials ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendCredentialsContract()); set { {_credentials = value;} } } + + /// Internal Acessors for CredentialsAuthorization + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendAuthorizationHeaderCredentials Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal.CredentialsAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractInternal)Credentials).Authorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractInternal)Credentials).Authorization = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendProperties()); set { {_property = value;} } } + + /// Internal Acessors for Proxy + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendProxyContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal.Proxy { get => (this._proxy = this._proxy ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendProxyContract()); set { {_proxy = value;} } } + + /// Internal Acessors for ServiceFabricCluster + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendServiceFabricClusterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal.ServiceFabricCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendPropertiesInternal)Property).ServiceFabricCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendPropertiesInternal)Property).ServiceFabricCluster = value; } + + /// Internal Acessors for Tl + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendTlsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal.Tl { get => (this._tl = this._tl ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendTlsProperties()); set { {_tl = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendProxyContract Proxy { get => (this._proxy = this._proxy ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendProxyContractInternal)Proxy).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendProxyContractInternal)Proxy).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendProxyContractInternal)Proxy).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendPropertiesInternal)Property).ServiceFabricClusterClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendPropertiesInternal)Property).ServiceFabricClusterClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendPropertiesInternal)Property).ServiceFabricClusterManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendPropertiesInternal)Property).ServiceFabricClusterMaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendPropertiesInternal)Property).ServiceFabricClusterServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendPropertiesInternal)Property).ServiceFabricClusterServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IBackendTlsProperties Tl { get => (this._tl = this._tl ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendTlsPropertiesInternal)Tl).ValidateCertificateChain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendTlsPropertiesInternal)Tl).ValidateCertificateName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendTlsPropertiesInternal)Tl).ValidateCertificateName = value ?? default(bool); } + + /// 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; } + /// + /// 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.Api20220801.IBackendCredentialsContractHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractQuery) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + /// 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.Api20220801.IX509CertificateName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + + } + /// Backend entity base Parameter set. + internal partial interface IBackendBaseParametersInternal + + { + /// Authentication Parameter value. + string AuthorizationParameter { get; set; } + /// Authentication Scheme name. + string AuthorizationScheme { get; set; } + /// Backend Credentials Contract Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContract Credentials { get; set; } + /// Authorization header authentication + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractHeader CredentialsHeader { get; set; } + /// Query Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractQuery CredentialsQuery { get; set; } + /// Backend Description. + string Description { get; set; } + /// Backend Properties contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendProperties Property { get; set; } + /// Backend gateway Contract Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + /// Backend Title. + string Title { get; set; } + /// Backend TLS Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendBaseParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendBaseParameters.json.cs new file mode 100644 index 000000000000..b11ae76ced50 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendBaseParameters.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.Api20220801 +{ + 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.Api20220801.BackendProperties.FromJson(__jsonProperties) : Property;} + {_credentials = If( json?.PropertyT("credentials"), out var __jsonCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendCredentialsContract.FromJson(__jsonCredentials) : Credentials;} + {_proxy = If( json?.PropertyT("proxy"), out var __jsonProxy) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendProxyContract.FromJson(__jsonProxy) : Proxy;} + {_tl = If( json?.PropertyT("tls"), out var __jsonTls) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendTlsProperties.FromJson(__jsonTls) : Tl;} + {_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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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 != (((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 ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCollection.cs new file mode 100644 index 000000000000..0a0a60dbd483 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Backend list representation. + public partial class BackendCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendContract[] _value; + + /// Backend values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCollection.json.cs new file mode 100644 index 000000000000..f6f3f912f381 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBackendContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendContract.cs new file mode 100644 index 000000000000..a5bfb7bc982c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendContract.cs @@ -0,0 +1,507 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend details. + public partial class BackendContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).AuthorizationParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).AuthorizationScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).AuthorizationScheme = value ?? null; } + + /// + /// 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.Api20220801.IBackendBaseParametersInternal)Property).CredentialsCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).CredentialsCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractHeader CredentialsHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).CredentialsHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractQuery CredentialsQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).CredentialsQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContractInternal.BackendProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Property = value; } + + /// Internal Acessors for Credentials + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContractInternal.Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Credentials = value; } + + /// Internal Acessors for CredentialsAuthorization + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendAuthorizationHeaderCredentials Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContractInternal.CredentialsAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).CredentialsAuthorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).CredentialsAuthorization = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Proxy + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendProxyContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContractInternal.Proxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Proxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Proxy = value; } + + /// Internal Acessors for ServiceFabricCluster + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendServiceFabricClusterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContractInternal.ServiceFabricCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricCluster = value; } + + /// Internal Acessors for Tl + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendTlsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContractInternal.Tl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Tl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendContractPropertiesInternal)Property).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ProxyPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ProxyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ProxyUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterMaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).TlValidateCertificateChain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).TlValidateCertificateName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendContractPropertiesInternal)Property).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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; } + /// + /// 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.Api20220801.IBackendCredentialsContractHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractQuery) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + /// 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.Api20220801.IX509CertificateName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendProperties BackendProperty { get; set; } + /// Backend Credentials Contract Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContract Credentials { get; set; } + /// Authorization header authentication + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractHeader CredentialsHeader { get; set; } + /// Query Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractQuery CredentialsQuery { get; set; } + /// Backend Description. + string Description { get; set; } + + string ETag { get; set; } + /// Backend entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + /// Backend Title. + string Title { get; set; } + /// Backend TLS Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendContract.json.cs new file mode 100644 index 000000000000..2f16778ddc85 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.BackendContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendContractProperties.cs new file mode 100644 index 000000000000..6e3a2159895c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendContractProperties.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + 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.Api20220801.IBackendContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParameters __backendBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationScheme = value ?? null; } + + /// Backend Credentials Contract Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContract Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendAuthorizationHeaderCredentials CredentialsAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsAuthorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractHeader CredentialsHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractQuery CredentialsQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Description = value ?? null; } + + /// Backend Properties contract + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendProperties Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendProxyContract Proxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Proxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ProxyPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendServiceFabricClusterProperties ServiceFabricCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterMaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendTlsProperties Tl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Tl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateChain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateName = value ?? default(bool); } + + /// 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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/BackendContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendContractProperties.json.cs new file mode 100644 index 000000000000..dc5669efe558 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IBackendContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendCredentialsContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCredentialsContract.cs new file mode 100644 index 000000000000..87128fedac93 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBackendCredentialsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendAuthorizationHeaderCredentials Authorization { get => (this._authorization = this._authorization ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendAuthorizationHeaderCredentialsInternal)Authorization).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendAuthorizationHeaderCredentialsInternal)Authorization).Scheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IBackendCredentialsContractHeader Header { get => (this._header = this._header ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendCredentialsContractHeader()); set => this._header = value; } + + /// Internal Acessors for Authorization + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendAuthorizationHeaderCredentials Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractInternal.Authorization { get => (this._authorization = this._authorization ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendAuthorizationHeaderCredentials()); set { {_authorization = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractQuery Query { get => (this._query = this._query ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractQuery) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IBackendCredentialsContractHeader Header { get; set; } + /// Query Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractQuery Query { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCredentialsContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCredentialsContract.json.cs new file mode 100644 index 000000000000..0cf8bd5b3801 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.BackendCredentialsContractQuery.FromJson(__jsonQuery) : Query;} + {_header = If( json?.PropertyT("header"), out var __jsonHeader) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendCredentialsContractHeader.FromJson(__jsonHeader) : Header;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendCredentialsContractHeader.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCredentialsContractHeader.cs new file mode 100644 index 000000000000..a2ec1406f8f7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Header Parameter description. + public partial class BackendCredentialsContractHeader : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractHeader, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendCredentialsContractHeader.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCredentialsContractHeader.dictionary.cs new file mode 100644 index 000000000000..8a6050f293a2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.BackendCredentialsContractHeader source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCredentialsContractHeader.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCredentialsContractHeader.json.cs new file mode 100644 index 000000000000..043e8b60f33d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBackendCredentialsContractHeader. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractHeader. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendCredentialsContractQuery.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCredentialsContractQuery.cs new file mode 100644 index 000000000000..6d37ece1529c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Query Parameter description. + public partial class BackendCredentialsContractQuery : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractQuery, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendCredentialsContractQuery.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCredentialsContractQuery.dictionary.cs new file mode 100644 index 000000000000..7c22f533ff29 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.BackendCredentialsContractQuery source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCredentialsContractQuery.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendCredentialsContractQuery.json.cs new file mode 100644 index 000000000000..940049328b1f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBackendCredentialsContractQuery. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractQuery. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendProperties.cs new file mode 100644 index 000000000000..4fc27cafb4b8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBackendProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendPropertiesInternal + { + + /// Internal Acessors for ServiceFabricCluster + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendServiceFabricClusterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendPropertiesInternal.ServiceFabricCluster { get => (this._serviceFabricCluster = this._serviceFabricCluster ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendServiceFabricClusterProperties()); set { {_serviceFabricCluster = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendServiceFabricClusterProperties ServiceFabricCluster { get => (this._serviceFabricCluster = this._serviceFabricCluster ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).MaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IX509CertificateName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendProperties.json.cs new file mode 100644 index 000000000000..3d320103d118 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.BackendServiceFabricClusterProperties.FromJson(__jsonServiceFabricCluster) : ServiceFabricCluster;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendProxyContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendProxyContract.cs new file mode 100644 index 000000000000..46f2054e5dff --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBackendProxyContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendProxyContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendProxyContract.json.cs new file mode 100644 index 000000000000..2edd2cf0a131 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBackendProxyContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendProxyContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendReconnectContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendReconnectContract.cs new file mode 100644 index 000000000000..02a3411bdf07 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Reconnect request parameters. + public partial class BackendReconnectContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendReconnectContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendReconnectPropertiesInternal)Property).After; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendReconnectProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendReconnectContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IBackendReconnectProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendReconnectProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendReconnectContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendReconnectContract.json.cs new file mode 100644 index 000000000000..cb78c7922348 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.BackendReconnectProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendReconnectContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendReconnectContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendReconnectProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendReconnectProperties.cs new file mode 100644 index 000000000000..3add34131339 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties to control reconnect requests. + public partial class BackendReconnectProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendReconnectProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendReconnectProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendReconnectProperties.json.cs new file mode 100644 index 000000000000..649ac76c9b34 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBackendReconnectProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendReconnectProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendServiceFabricClusterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendServiceFabricClusterProperties.cs new file mode 100644 index 000000000000..48422203b902 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBackendServiceFabricClusterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IX509CertificateName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IX509CertificateName[] ServerX509Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendServiceFabricClusterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendServiceFabricClusterProperties.json.cs new file mode 100644 index 000000000000..636176a2b7f8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IX509CertificateName) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.X509CertificateName.FromJson(__k) )) ))() : null : ServerX509Name;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendServiceFabricClusterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendServiceFabricClusterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendTlsProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendTlsProperties.cs new file mode 100644 index 000000000000..16bb66f8862d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties controlling TLS Certificate Validation. + public partial class BackendTlsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendTlsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendTlsProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendTlsProperties.json.cs new file mode 100644 index 000000000000..f4aa571a88f1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBackendTlsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendTlsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendUpdateParameterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendUpdateParameterProperties.cs new file mode 100644 index 000000000000..b5f6df60f27c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendUpdateParameterProperties.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + 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.Api20220801.IBackendUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParameterPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParameters __backendBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationScheme = value ?? null; } + + /// Backend Credentials Contract Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContract Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendAuthorizationHeaderCredentials CredentialsAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsAuthorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractHeader CredentialsHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractQuery CredentialsQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Description = value ?? null; } + + /// Backend Properties contract + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendProperties Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendProxyContract Proxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Proxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ProxyPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendServiceFabricClusterProperties ServiceFabricCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterMaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendTlsProperties Tl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).Tl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateChain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateName = value ?? default(bool); } + + /// 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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/BackendUpdateParameterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..4ce76aa1499d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IBackendUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendUpdateParameters.cs new file mode 100644 index 000000000000..34aee04752a5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendUpdateParameters.cs @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend update parameters. + public partial class BackendUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).AuthorizationParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).AuthorizationScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).AuthorizationScheme = value ?? null; } + + /// + /// 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.Api20220801.IBackendBaseParametersInternal)Property).CredentialsCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).CredentialsCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractHeader CredentialsHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).CredentialsHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractQuery CredentialsQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).CredentialsQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Description = value ?? null; } + + /// Internal Acessors for BackendProperty + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParametersInternal.BackendProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Property = value; } + + /// Internal Acessors for Credentials + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParametersInternal.Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Credentials = value; } + + /// Internal Acessors for CredentialsAuthorization + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendAuthorizationHeaderCredentials Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParametersInternal.CredentialsAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).CredentialsAuthorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).CredentialsAuthorization = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BackendUpdateParameterProperties()); set { {_property = value;} } } + + /// Internal Acessors for Proxy + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendProxyContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParametersInternal.Proxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Proxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Proxy = value; } + + /// Internal Acessors for ServiceFabricCluster + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendServiceFabricClusterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParametersInternal.ServiceFabricCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricCluster = value; } + + /// Internal Acessors for Tl + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendTlsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParametersInternal.Tl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Tl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).Tl = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendUpdateParameterPropertiesInternal)Property).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ProxyPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ProxyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ProxyUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterMaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).TlValidateCertificateChain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendBaseParametersInternal)Property).TlValidateCertificateName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendBaseParametersInternal)Property).TlValidateCertificateName = value ?? default(bool); } + + /// 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.Api20220801.IBackendUpdateParameterPropertiesInternal)Property).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + /// + /// 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.Api20220801.IBackendCredentialsContractHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractQuery) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + /// 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.Api20220801.IX509CertificateName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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 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.Api20220801.IBackendProperties BackendProperty { get; set; } + /// Backend Credentials Contract Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContract Credentials { get; set; } + /// Authorization header authentication + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBackendCredentialsContractHeader CredentialsHeader { get; set; } + /// Query Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendCredentialsContractQuery CredentialsQuery { get; set; } + /// Backend Description. + string Description { get; set; } + /// Backend entity update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + /// Backend Title. + string Title { get; set; } + /// Backend TLS Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BackendUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BackendUpdateParameters.json.cs new file mode 100644 index 000000000000..9846c947da33 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.BackendUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBackendUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BodyDiagnosticSettings.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BodyDiagnosticSettings.cs new file mode 100644 index 000000000000..ad74d2ca0fa7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Body logging settings. + public partial class BodyDiagnosticSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/BodyDiagnosticSettings.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/BodyDiagnosticSettings.json.cs new file mode 100644 index 000000000000..81188aaa19e4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IBodyDiagnosticSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CacheCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CacheCollection.cs new file mode 100644 index 000000000000..56d101588147 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Caches list representation. + public partial class CacheCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/CacheCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CacheCollection.json.cs new file mode 100644 index 000000000000..48460f95ab1d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ICacheContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CacheContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CacheContract.cs new file mode 100644 index 000000000000..ef57040a020d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Cache details. + public partial class CacheContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheContractPropertiesInternal)Property).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ICacheContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheContractPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheContractPropertiesInternal)Property).UseFromLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/CacheContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CacheContract.json.cs new file mode 100644 index 000000000000..b2e4c1946324 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.CacheContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CacheContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CacheContractProperties.cs new file mode 100644 index 000000000000..e17c012df82e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the Cache contract. + public partial class CacheContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CacheContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CacheContractProperties.json.cs new file mode 100644 index 000000000000..eed1962bcddb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ICacheContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CacheUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CacheUpdateParameters.cs new file mode 100644 index 000000000000..66deaa9ab792 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Cache update details. + public partial class CacheUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheUpdatePropertiesInternal)Property).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheUpdatePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheUpdatePropertiesInternal)Property).Description = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.CacheUpdateProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheUpdatePropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICacheUpdatePropertiesInternal)Property).UseFromLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/CacheUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CacheUpdateParameters.json.cs new file mode 100644 index 000000000000..783c291461c4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.CacheUpdateProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CacheUpdateProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CacheUpdateProperties.cs new file mode 100644 index 000000000000..558abf6e791e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ICacheUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CacheUpdateProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CacheUpdateProperties.json.cs new file mode 100644 index 000000000000..565570435b78 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ICacheUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICacheUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CertificateCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateCollection.cs new file mode 100644 index 000000000000..f4b84242cca6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Certificates list representation. + public partial class CertificateCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateCollection.json.cs new file mode 100644 index 000000000000..3ae9292d087e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ICertificateContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CertificateConfiguration.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateConfiguration.cs new file mode 100644 index 000000000000..e11f40b0e1be --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ICertificateConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateInformation _certificate; + + /// Certificate information. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateInformation Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateInformationInternal)Certificate).Expiry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateInformationInternal)Certificate).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateInformationInternal)Certificate).Thumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateConfigurationInternal.Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/CertificateConfiguration.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateConfiguration.json.cs new file mode 100644 index 000000000000..3bf3b9b39b28 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.ICertificateConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CertificateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateContract.cs new file mode 100644 index 000000000000..dd98b92ccda9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Certificate details. + public partial class CertificateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateContractPropertiesInternal)Property).ExpirationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateContractPropertiesInternal)Property).KeyVaultIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateContractPropertiesInternal)Property).KeyVaultSecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateContractPropertiesInternal)Property).LastStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateContractPropertiesInternal)Property).LastStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateContractPropertiesInternal)Property).LastStatusTimeStampUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractInternal.KeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractPropertiesInternal)Property).KeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractPropertiesInternal)Property).KeyVault = value; } + + /// Internal Acessors for KeyVaultLastStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultLastAccessStatusContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractInternal.KeyVaultLastStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractPropertiesInternal)Property).KeyVaultLastStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractPropertiesInternal)Property).KeyVaultLastStatus = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ICertificateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateContractPropertiesInternal)Property).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateContractPropertiesInternal)Property).Thumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/CertificateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateContract.json.cs new file mode 100644 index 000000000000..f5ccaf6900e8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.CertificateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CertificateContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateContractProperties.cs new file mode 100644 index 000000000000..5283feeb1c64 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the Certificate contract. + public partial class CertificateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IKeyVaultContractProperties KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusTimeStampUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusTimeStampUtc = value ?? default(global::System.DateTime); } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractPropertiesInternal.KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.KeyVaultContractProperties()); set { {_keyVault = value;} } } + + /// Internal Acessors for KeyVaultLastStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultLastAccessStatusContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractPropertiesInternal.KeyVaultLastStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractPropertiesInternal)KeyVault).LastStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/CertificateContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateContractProperties.json.cs new file mode 100644 index 000000000000..d29229d06e31 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.ICertificateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CertificateCreateOrUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateCreateOrUpdateParameters.cs new file mode 100644 index 000000000000..b51c9be4799c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Certificate create or update details. + public partial class CertificateCreateOrUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateCreateOrUpdatePropertiesInternal)Property).Data; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateCreateOrUpdatePropertiesInternal)Property).KeyVaultIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateCreateOrUpdatePropertiesInternal)Property).KeyVaultSecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdatePropertiesInternal)Property).KeyVaultSecretIdentifier = value ?? null; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdateParametersInternal.KeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdatePropertiesInternal)Property).KeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdatePropertiesInternal)Property).KeyVault = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateCreateOrUpdatePropertiesInternal)Property).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdatePropertiesInternal)Property).Password = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateCreateOrUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ICertificateCreateOrUpdateProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateCreateOrUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateCreateOrUpdateParameters.json.cs new file mode 100644 index 000000000000..0d4fb5cbd180 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.CertificateCreateOrUpdateProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CertificateCreateOrUpdateProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateCreateOrUpdateProperties.cs new file mode 100644 index 000000000000..efb08e227b5d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ICertificateCreateOrUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IKeyVaultContractCreateProperties KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier = value ?? null; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdatePropertiesInternal.KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/CertificateCreateOrUpdateProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateCreateOrUpdateProperties.json.cs new file mode 100644 index 000000000000..3307dce4e78f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.ICertificateCreateOrUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateCreateOrUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CertificateInformation.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateInformation.cs new file mode 100644 index 000000000000..37318c571057 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// SSL certificate information. + public partial class CertificateInformation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateInformation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/CertificateInformation.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/CertificateInformation.json.cs new file mode 100644 index 000000000000..a392da480167 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ICertificateInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ClientSecretContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ClientSecretContract.cs new file mode 100644 index 000000000000..6a79ac7b2fb8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IClientSecretContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ClientSecretContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ClientSecretContract.json.cs new file mode 100644 index 000000000000..d69155683c6e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IClientSecretContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IClientSecretContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckRequest.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckRequest.cs new file mode 100644 index 000000000000..7b0eff63ff56 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IConnectivityCheckRequest, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestDestination Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestDestinationInternal)Destination).Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestDestinationInternal)Destination).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHttpHeader[] HttpConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfigurationHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfigurationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfigurationValidStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfigurationValidStatusCode = value ?? null /* arrayOf */; } + + /// Internal Acessors for Destination + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestDestination Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestInternal.Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ConnectivityCheckRequestDestination()); set { {_destination = value;} } } + + /// Internal Acessors for ProtocolConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestInternal.ProtocolConfiguration { get => (this._protocolConfiguration = this._protocolConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ConnectivityCheckRequestProtocolConfiguration()); set { {_protocolConfiguration = value;} } } + + /// Internal Acessors for ProtocolConfigurationHttpConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestInternal.ProtocolConfigurationHttpConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfiguration = value; } + + /// Internal Acessors for Source + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestSource Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestInternal.Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IConnectivityCheckRequestProtocolConfiguration ProtocolConfiguration { get => (this._protocolConfiguration = this._protocolConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ConnectivityCheckRequestProtocolConfiguration()); set => this._protocolConfiguration = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestSource Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestSourceInternal)Source).Instance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestSourceInternal)Source).Region; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHttpHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IConnectivityCheckRequestProtocolConfiguration ProtocolConfiguration { get; set; } + /// Configuration for HTTP or HTTPS requests. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration ProtocolConfigurationHttpConfiguration { get; set; } + /// Definitions about the connectivity check origin. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckRequest.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckRequest.json.cs new file mode 100644 index 000000000000..2f41ba7b2de0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ConnectivityCheckRequestSource.FromJson(__jsonSource) : Source;} + {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ConnectivityCheckRequestDestination.FromJson(__jsonDestination) : Destination;} + {_protocolConfiguration = If( json?.PropertyT("protocolConfiguration"), out var __jsonProtocolConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckRequestDestination.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckRequestDestination.cs new file mode 100644 index 000000000000..46543b552c10 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The connectivity check operation destination. + public partial class ConnectivityCheckRequestDestination : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestDestination, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckRequestDestination.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckRequestDestination.json.cs new file mode 100644 index 000000000000..6cb3d6c39e67 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IConnectivityCheckRequestDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckRequestProtocolConfiguration.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckRequestProtocolConfiguration.cs new file mode 100644 index 000000000000..efd5e1855477 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Protocol-specific configuration. + public partial class ConnectivityCheckRequestProtocolConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration HttpConfiguration { get => (this._httpConfiguration = this._httpConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHttpHeader[] HttpConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal)HttpConfiguration).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal)HttpConfiguration).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal)HttpConfiguration).ValidStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal)HttpConfiguration).ValidStatusCode = value ?? null /* arrayOf */; } + + /// Internal Acessors for HttpConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationInternal.HttpConfiguration { get => (this._httpConfiguration = this._httpConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHttpHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration HttpConfiguration { get; set; } + /// List of headers to be included in the request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckRequestProtocolConfiguration.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckRequestProtocolConfiguration.json.cs new file mode 100644 index 000000000000..2bd026dc30dc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.FromJson(__jsonHttpConfiguration) : HttpConfiguration;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.cs new file mode 100644 index 000000000000..b67d347d658f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IHttpHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.json.cs new file mode 100644 index 000000000000..57b9ddcb9935 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IHttpHeader) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.HttpHeader.FromJson(__p) )) ))() : null : Header;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckRequestSource.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckRequestSource.cs new file mode 100644 index 000000000000..f3d5b03d8a91 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IConnectivityCheckRequestSource, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckRequestSource.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckRequestSource.json.cs new file mode 100644 index 000000000000..324eb0af56cd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IConnectivityCheckRequestSource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckRequestSource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckResponse.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckResponse.cs new file mode 100644 index 000000000000..867893da7ccd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Information on the connectivity status. + public partial class ConnectivityCheckResponse : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckResponse, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IConnectivityCheckResponseInternal.ConnectionStatus { get => this._connectionStatus; set { {_connectionStatus = value;} } } + + /// Internal Acessors for Hop + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityHop[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckResponseInternal.Hop { get => this._hop; set { {_hop = value;} } } + + /// Internal Acessors for MaxLatencyInMS + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckResponseInternal.MaxLatencyInMS { get => this._maxLatencyInMS; set { {_maxLatencyInMS = value;} } } + + /// Internal Acessors for MinLatencyInMS + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckResponseInternal.MinLatencyInMS { get => this._minLatencyInMS; set { {_minLatencyInMS = value;} } } + + /// Internal Acessors for ProbesFailed + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckResponseInternal.ProbesFailed { get => this._probesFailed; set { {_probesFailed = value;} } } + + /// Internal Acessors for ProbesSent + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityHop) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ConnectivityCheckResponse.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityCheckResponse.json.cs new file mode 100644 index 000000000000..c564a8bb1653 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IConnectivityHop) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityCheckResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityCheckResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityHop.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityHop.cs new file mode 100644 index 000000000000..70d409b1d0e6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IConnectivityHop, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IConnectivityIssue[] Issue { get => this._issue; } + + /// Internal Acessors for Address + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityHopInternal.Address { get => this._address; set { {_address = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityHopInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Issue + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityIssue[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityHopInternal.Issue { get => this._issue; set { {_issue = value;} } } + + /// Internal Acessors for NextHopId + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityHopInternal.NextHopId { get => this._nextHopId; set { {_nextHopId = value;} } } + + /// Internal Acessors for ResourceId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityHopInternal.ResourceId { get => this._resourceId; set { {_resourceId = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityIssue) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ConnectivityHop.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityHop.json.cs new file mode 100644 index 000000000000..03d8588b4a5a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IConnectivityIssue) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ConnectivityIssue.FromJson(__p) )) ))() : null : Issue;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityHop. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityHop. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityIssue.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityIssue.cs new file mode 100644 index 000000000000..09c62e215fc8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IConnectivityIssue, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityIssueInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContext[] Context { get => this._context; } + + /// Internal Acessors for Context + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContext[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IIssueContext) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ConnectivityIssue.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityIssue.json.cs new file mode 100644 index 000000000000..e4e9054dca92 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueContext) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IssueContext.FromJson(__u) )) ))() : null : Context;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityIssue. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityIssue. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityStatusContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityStatusContract.cs new file mode 100644 index 000000000000..0c92a5c43a3f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IConnectivityStatusContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ConnectivityStatusContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ConnectivityStatusContract.json.cs new file mode 100644 index 000000000000..719216bc61fa --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IConnectivityStatusContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IConnectivityStatusContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ContentItemCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentItemCollection.cs new file mode 100644 index 000000000000..950f85b851c0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged list of content items. + public partial class ContentItemCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentItemCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentItemCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentItemCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentItemContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IContentItemContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentItemContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentItemCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentItemCollection.json.cs new file mode 100644 index 000000000000..b01ea9f8a11f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IContentItemContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentItemCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentItemCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ContentItemContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentItemContract.cs new file mode 100644 index 000000000000..4e04124ccfde --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Content type contract details. + public partial class ContentItemContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentItemContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IContentItemContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IContentItemContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentItemContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentItemContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentItemContract.json.cs new file mode 100644 index 000000000000..62f8ce729edc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ContentItemContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentItemContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentItemContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ContentItemContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentItemContractProperties.cs new file mode 100644 index 000000000000..efd14a376ca1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Dictionary of + public partial class ContentItemContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentItemContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ContentItemContractProperties.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentItemContractProperties.dictionary.cs new file mode 100644 index 000000000000..584eb6782432 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ContentItemContractProperties source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentItemContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentItemContractProperties.json.cs new file mode 100644 index 000000000000..000a0c228c20 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IContentItemContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentItemContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ContentTypeCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentTypeCollection.cs new file mode 100644 index 000000000000..a497b6139f4e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged list of content types. + public partial class ContentTypeCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IContentTypeContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentTypeContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentTypeCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentTypeCollection.json.cs new file mode 100644 index 000000000000..5361e181edf6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IContentTypeContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentTypeCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ContentTypeContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentTypeContract.cs new file mode 100644 index 000000000000..b41af26315a7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Content type contract details. + public partial class ContentTypeContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentTypeContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentTypeContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentTypeContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentTypeContractPropertiesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeContractPropertiesInternal)Property).Name = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentTypeContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentTypeContractPropertiesInternal)Property).Schema; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IContentTypeContractPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ContentTypeContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentTypeContract.json.cs new file mode 100644 index 000000000000..8b16d9c45d96 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ContentTypeContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ContentTypeContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentTypeContractProperties.cs new file mode 100644 index 000000000000..ce245b67eb22 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ContentTypeContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ContentTypeContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ContentTypeContractProperties.json.cs new file mode 100644 index 000000000000..3cb82c45fcb4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IContentTypeContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IContentTypeContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DataMasking.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DataMasking.cs new file mode 100644 index 000000000000..3a2c7ad478bc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DataMasking : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] Header { get => this._header; set => this._header = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] QueryParam { get; set; } + + } + internal partial interface IDataMaskingInternal + + { + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] Header { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] QueryParam { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/DataMasking.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DataMasking.json.cs new file mode 100644 index 000000000000..abdfb8516a9e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IDataMaskingEntity) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.DataMaskingEntity.FromJson(__p) )) ))() : null : Header;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DataMaskingEntity.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DataMaskingEntity.cs new file mode 100644 index 000000000000..b306b6dfb42f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DataMaskingEntity : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DataMaskingEntity.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DataMaskingEntity.json.cs new file mode 100644 index 000000000000..10ca1bfd99be --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IDataMaskingEntity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DeletedServiceContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DeletedServiceContract.cs new file mode 100644 index 000000000000..e7b0b8d4e14d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/DeletedServiceContract.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Deleted API Management Service information. + public partial class DeletedServiceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeletedServiceContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeletedServiceContractInternal, + 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(); + + /// + /// 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.Api20220801.IDeletedServiceContractPropertiesInternal)Property).DeletionDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDeletedServiceContractInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeletedServiceContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeletedServiceContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IDeletedServiceContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDeletedServiceContractPropertiesInternal)Property).ScheduledPurgeDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDeletedServiceContractPropertiesInternal)Property).ServiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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() + { + + } + + /// 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.Api20220801.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/generated/api/Models/Api20220801/DeletedServiceContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DeletedServiceContract.json.cs new file mode 100644 index 000000000000..f2bc71ec95e6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.IDeletedServiceContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeletedServiceContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DeletedServiceContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DeletedServiceContractProperties.cs new file mode 100644 index 000000000000..971cb850d686 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DeletedServiceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeletedServiceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DeletedServiceContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DeletedServiceContractProperties.json.cs new file mode 100644 index 000000000000..e1a087da2ad6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IDeletedServiceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeletedServiceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DeletedServicesCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DeletedServicesCollection.cs new file mode 100644 index 000000000000..9855d7f6e6af --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IDeletedServicesCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeletedServicesCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeletedServicesCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeletedServiceContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDeletedServiceContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDeletedServiceContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDeletedServiceContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/DeletedServicesCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DeletedServicesCollection.json.cs new file mode 100644 index 000000000000..cc3a900abfb9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IDeletedServiceContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDeletedServicesCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeletedServicesCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DeployConfigurationParameterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DeployConfigurationParameterProperties.cs new file mode 100644 index 000000000000..3cd6b8be6a8a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IDeployConfigurationParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DeployConfigurationParameterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DeployConfigurationParameterProperties.json.cs new file mode 100644 index 000000000000..7e5c964a3367 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IDeployConfigurationParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeployConfigurationParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DeployConfigurationParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DeployConfigurationParameters.cs new file mode 100644 index 000000000000..38921c3ee3e5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Deploy Tenant Configuration Contract. + public partial class DeployConfigurationParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeployConfigurationParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDeployConfigurationParameterPropertiesInternal)Property).Branch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDeployConfigurationParameterPropertiesInternal)Property).Force; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeployConfigurationParameterPropertiesInternal)Property).Force = value ?? default(bool); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeployConfigurationParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeployConfigurationParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.DeployConfigurationParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDeployConfigurationParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDeployConfigurationParameterProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/DeployConfigurationParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DeployConfigurationParameters.json.cs new file mode 100644 index 000000000000..bab4d36e07f9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.DeployConfigurationParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeployConfigurationParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDeployConfigurationParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DiagnosticCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DiagnosticCollection.cs new file mode 100644 index 000000000000..5defe203212d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Diagnostic list representation. + public partial class DiagnosticCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/DiagnosticCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DiagnosticCollection.json.cs new file mode 100644 index 000000000000..477516bfad89 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IDiagnosticContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DiagnosticContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DiagnosticContract.cs new file mode 100644 index 000000000000..73a1bccad7cf --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Diagnostic details. + public partial class DiagnosticContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).AlwaysLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendRequestBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] BackendRequestDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendRequestDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] BackendRequestDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendRequestDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendRequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendResponseBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] BackendResponseDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendResponseDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] BackendResponseDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendResponseDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendResponseHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendRequestBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] FrontendRequestDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendRequestDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] FrontendRequestDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendRequestDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendRequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendResponseBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] FrontendResponseDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendResponseDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] FrontendResponseDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendResponseDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendResponseHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).HttpCorrelationProtocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).LogClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).LoggerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.Backend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).Backend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).Backend = value; } + + /// Internal Acessors for BackendRequest + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.BackendRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendRequest = value; } + + /// Internal Acessors for BackendRequestBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.BackendRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendRequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendRequestBody = value; } + + /// Internal Acessors for BackendRequestDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.BackendRequestDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendRequestDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendRequestDataMasking = value; } + + /// Internal Acessors for BackendResponse + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.BackendResponse { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendResponse; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendResponse = value; } + + /// Internal Acessors for BackendResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.BackendResponseBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendResponseBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendResponseBody = value; } + + /// Internal Acessors for BackendResponseDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.BackendResponseDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendResponseDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).BackendResponseDataMasking = value; } + + /// Internal Acessors for Frontend + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.Frontend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).Frontend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).Frontend = value; } + + /// Internal Acessors for FrontendRequest + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.FrontendRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendRequest = value; } + + /// Internal Acessors for FrontendRequestBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.FrontendRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendRequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendRequestBody = value; } + + /// Internal Acessors for FrontendRequestDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.FrontendRequestDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendRequestDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendRequestDataMasking = value; } + + /// Internal Acessors for FrontendResponse + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.FrontendResponse { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendResponse; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendResponse = value; } + + /// Internal Acessors for FrontendResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.FrontendResponseBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendResponseBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendResponseBody = value; } + + /// Internal Acessors for FrontendResponseDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.FrontendResponseDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendResponseDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).FrontendResponseDataMasking = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.DiagnosticContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Sampling + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISamplingSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractInternal.Sampling { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).Sampling; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).OperationNameFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal)Property).OperationNameFormat = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).SamplingPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).SamplingType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractPropertiesInternal)Property).Verbosity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettings Backend { get; set; } + /// Diagnostic settings for request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic BackendRequest { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings BackendRequestBody { get; set; } + /// Number of request body bytes to log. + int? BackendRequestBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking BackendRequestDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] BackendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] BackendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] BackendRequestHeader { get; set; } + /// Diagnostic settings for response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic BackendResponse { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings BackendResponseBody { get; set; } + /// Number of request body bytes to log. + int? BackendResponseBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking BackendResponseDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] BackendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettings Frontend { get; set; } + /// Diagnostic settings for request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic FrontendRequest { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings FrontendRequestBody { get; set; } + /// Number of request body bytes to log. + int? FrontendRequestBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking FrontendRequestDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] FrontendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] FrontendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] FrontendRequestHeader { get; set; } + /// Diagnostic settings for response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic FrontendResponse { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings FrontendResponseBody { get; set; } + /// Number of request body bytes to log. + int? FrontendResponseBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking FrontendResponseDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] FrontendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractProperties Property { get; set; } + /// Sampling settings for Diagnostic. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DiagnosticContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DiagnosticContract.json.cs new file mode 100644 index 000000000000..6be78c5c227f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.DiagnosticContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DiagnosticContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DiagnosticContractProperties.cs new file mode 100644 index 000000000000..a4d7752c5147 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Diagnostic Entity Properties + public partial class DiagnosticContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPipelineDiagnosticSettings Backend { get => (this._backend = this._backend ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).RequestBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] BackendRequestDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).RequestDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] BackendRequestDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).RequestDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).ResponseBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] BackendResponseDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).ResponseDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] BackendResponseDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).ResponseDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).ResponseHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).ResponseHeader = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettings Frontend { get => (this._frontend = this._frontend ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).RequestBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] FrontendRequestDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).RequestDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] FrontendRequestDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).RequestDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).ResponseBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] FrontendResponseDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).ResponseDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] FrontendResponseDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).ResponseDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).ResponseHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.Backend { get => (this._backend = this._backend ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PipelineDiagnosticSettings()); set { {_backend = value;} } } + + /// Internal Acessors for BackendRequest + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.BackendRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).Request = value; } + + /// Internal Acessors for BackendRequestBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.BackendRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).RequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).RequestBody = value; } + + /// Internal Acessors for BackendRequestDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.BackendRequestDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).RequestDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).RequestDataMasking = value; } + + /// Internal Acessors for BackendResponse + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.BackendResponse { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).Response = value; } + + /// Internal Acessors for BackendResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.BackendResponseBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).ResponseBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).ResponseBody = value; } + + /// Internal Acessors for BackendResponseDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.BackendResponseDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).ResponseDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Backend).ResponseDataMasking = value; } + + /// Internal Acessors for Frontend + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.Frontend { get => (this._frontend = this._frontend ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PipelineDiagnosticSettings()); set { {_frontend = value;} } } + + /// Internal Acessors for FrontendRequest + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.FrontendRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).Request = value; } + + /// Internal Acessors for FrontendRequestBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.FrontendRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).RequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).RequestBody = value; } + + /// Internal Acessors for FrontendRequestDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.FrontendRequestDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).RequestDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).RequestDataMasking = value; } + + /// Internal Acessors for FrontendResponse + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.FrontendResponse { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).Response = value; } + + /// Internal Acessors for FrontendResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.FrontendResponseBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).ResponseBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).ResponseBody = value; } + + /// Internal Acessors for FrontendResponseDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.FrontendResponseDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).ResponseDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal)Frontend).ResponseDataMasking = value; } + + /// Internal Acessors for Sampling + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISamplingSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractPropertiesInternal.Sampling { get => (this._sampling = this._sampling ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ISamplingSettings Sampling { get => (this._sampling = this._sampling ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISamplingSettingsInternal)Sampling).Percentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISamplingSettingsInternal)Sampling).SamplingType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettings Backend { get; set; } + /// Diagnostic settings for request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic BackendRequest { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings BackendRequestBody { get; set; } + /// Number of request body bytes to log. + int? BackendRequestBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking BackendRequestDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] BackendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] BackendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] BackendRequestHeader { get; set; } + /// Diagnostic settings for response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic BackendResponse { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings BackendResponseBody { get; set; } + /// Number of request body bytes to log. + int? BackendResponseBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking BackendResponseDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] BackendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPipelineDiagnosticSettings Frontend { get; set; } + /// Diagnostic settings for request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic FrontendRequest { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings FrontendRequestBody { get; set; } + /// Number of request body bytes to log. + int? FrontendRequestBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking FrontendRequestDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] FrontendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] FrontendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] FrontendRequestHeader { get; set; } + /// Diagnostic settings for response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic FrontendResponse { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings FrontendResponseBody { get; set; } + /// Number of request body bytes to log. + int? FrontendResponseBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking FrontendResponseDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] FrontendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/DiagnosticContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DiagnosticContractProperties.json.cs new file mode 100644 index 000000000000..bebda792b810 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.SamplingSettings.FromJson(__jsonSampling) : Sampling;} + {_frontend = If( json?.PropertyT("frontend"), out var __jsonFrontend) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PipelineDiagnosticSettings.FromJson(__jsonFrontend) : Frontend;} + {_backend = If( json?.PropertyT("backend"), out var __jsonBackend) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDiagnosticContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDiagnosticContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DocumentationCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationCollection.cs new file mode 100644 index 000000000000..9ad5b1425c4c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Documentation list representation. + public partial class DocumentationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDocumentationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDocumentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDocumentationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationCollection.json.cs new file mode 100644 index 000000000000..2ebb9850d4ca --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IDocumentationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDocumentationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DocumentationContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationContract.cs new file mode 100644 index 000000000000..5c07abbf6692 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationContract.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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Markdown documentation details. + public partial class DocumentationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api30.IResourceAutoGenerated __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ResourceAutoGenerated(); + + /// 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.Api20220801.IDocumentationContractPropertiesInternal)Property).Content; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.DocumentationContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).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.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDocumentationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.DocumentationContractProperties()); set => this._property = value; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType = 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.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType)""); } + + /// 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.Api20220801.IDocumentationContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).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.Api20220801.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(__resourceAutoGenerated), __resourceAutoGenerated); + await eventListener.AssertObjectIsValid(nameof(__resourceAutoGenerated), __resourceAutoGenerated); + } + } + /// Markdown documentation details. + public partial interface IDocumentationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGenerated + { + /// 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.Api30.IResourceAutoGeneratedInternal + { + /// Markdown documentation content. + string Content { get; set; } + + string ETag { get; set; } + /// Markdown Documentation details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationContractProperties Property { get; set; } + /// documentation title. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationContract.json.cs new file mode 100644 index 000000000000..eb12b21247d8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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; + } + __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ResourceAutoGenerated(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.DocumentationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; + } + __resourceAutoGenerated?.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/generated/api/Models/Api20220801/DocumentationContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationContractProperties.cs new file mode 100644 index 000000000000..50d13a805525 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Markdown documentation details. + public partial class DocumentationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DocumentationContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationContractProperties.json.cs new file mode 100644 index 000000000000..1c533214da57 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IDocumentationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/DocumentationUpdateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationUpdateContract.cs new file mode 100644 index 000000000000..d47c12f67dcc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Documentation update contract details. + public partial class DocumentationUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDocumentationContractPropertiesInternal)Property).Content; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationContractPropertiesInternal)Property).Content = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.DocumentationContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDocumentationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDocumentationContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDocumentationContractProperties Property { get; set; } + /// documentation title. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationUpdateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/DocumentationUpdateContract.json.cs new file mode 100644 index 000000000000..788b074d5d21 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.DocumentationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDocumentationUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EmailTemplateCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateCollection.cs new file mode 100644 index 000000000000..a854a455bfbd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged email template list representation. + public partial class EmailTemplateCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateCollection.json.cs new file mode 100644 index 000000000000..ad9ef58ca836 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IEmailTemplateContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EmailTemplateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateContract.cs new file mode 100644 index 000000000000..fc98c7b41b5d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template details. + public partial class EmailTemplateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateContractPropertiesInternal)Property).Body; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IEmailTemplateContractInternal.IsDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContractPropertiesInternal)Property).IsDefault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContractPropertiesInternal)Property).IsDefault = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateParametersContractProperties[] Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContractPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContractPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateContractPropertiesInternal)Property).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IEmailTemplateParametersContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateParametersContractProperties[] Parameter { get; set; } + /// Email Template entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EmailTemplateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateContract.json.cs new file mode 100644 index 000000000000..3fb9057eaa47 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.EmailTemplateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EmailTemplateContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateContractProperties.cs new file mode 100644 index 000000000000..36fc3347cfbb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template Contract properties. + public partial class EmailTemplateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateContractPropertiesInternal.IsDefault { get => this._isDefault; set { {_isDefault = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IEmailTemplateParametersContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/EmailTemplateContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateContractProperties.json.cs new file mode 100644 index 000000000000..f8c97ba12db4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IEmailTemplateParametersContractProperties) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.EmailTemplateParametersContractProperties.FromJson(__u) )) ))() : null : Parameter;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EmailTemplateParametersContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateParametersContractProperties.cs new file mode 100644 index 000000000000..e0303844cee0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template Parameter contract. + public partial class EmailTemplateParametersContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateParametersContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EmailTemplateParametersContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateParametersContractProperties.json.cs new file mode 100644 index 000000000000..94020a0bcc5a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IEmailTemplateParametersContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateParametersContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EmailTemplateUpdateParameterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateUpdateParameterProperties.cs new file mode 100644 index 000000000000..899030b66b91 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template Update Contract properties. + public partial class EmailTemplateUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IEmailTemplateParametersContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/EmailTemplateUpdateParameterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..da9f4525a798 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IEmailTemplateParametersContractProperties) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.EmailTemplateParametersContractProperties.FromJson(__u) )) ))() : null : Parameter;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EmailTemplateUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateUpdateParameters.cs new file mode 100644 index 000000000000..21cd68df1ced --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template update Parameters. + public partial class EmailTemplateUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateUpdateParameterPropertiesInternal)Property).Body; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateUpdateParameterPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateUpdateParameterPropertiesInternal)Property).Description = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateParametersContractProperties[] Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateUpdateParameterPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateUpdateParameterPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateUpdateParameterPropertiesInternal)Property).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateUpdateParameterPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateParametersContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEmailTemplateParametersContractProperties[] Parameter { get; set; } + /// Email Template Update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EmailTemplateUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EmailTemplateUpdateParameters.json.cs new file mode 100644 index 000000000000..32c9296ef6b9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.EmailTemplateUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEmailTemplateUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EndpointDependency.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EndpointDependency.cs new file mode 100644 index 000000000000..0d3ea21be917 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IEndpointDependency, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IEndpointDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEndpointDetail[] EndpointDetail { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/EndpointDependency.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EndpointDependency.json.cs new file mode 100644 index 000000000000..a6ba4ee49a1a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IEndpointDetail) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.EndpointDetail.FromJson(__u) )) ))() : null : EndpointDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEndpointDependency. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEndpointDependency. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EndpointDetail.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EndpointDetail.cs new file mode 100644 index 000000000000..bbdc06a88bed --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IEndpointDetail, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/EndpointDetail.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/EndpointDetail.json.cs new file mode 100644 index 000000000000..2b9d63897344 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IEndpointDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IEndpointDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ErrorFieldContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ErrorFieldContract.cs new file mode 100644 index 000000000000..ebea10ee5fa1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Error Field contract. + public partial class ErrorFieldContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorFieldContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ErrorFieldContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ErrorFieldContract.json.cs new file mode 100644 index 000000000000..55f8b7bad1fd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IErrorFieldContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorFieldContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ErrorResponse.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ErrorResponse.cs new file mode 100644 index 000000000000..1c49582a372b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Error Response. + public partial class ErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorResponseBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorFieldContract[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorResponseBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorResponseBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorFieldContract[] Detail { get; set; } + /// Properties of the Error Response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ErrorResponse.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ErrorResponse.json.cs new file mode 100644 index 000000000000..d85c1c5fcecd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ErrorResponseBody.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ErrorResponseBody.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ErrorResponseBody.cs new file mode 100644 index 000000000000..1ae08211ef42 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Error Body contract. + public partial class ErrorResponseBody : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBody, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ErrorResponseBody.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ErrorResponseBody.json.cs new file mode 100644 index 000000000000..a11e7bdf6fde --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IErrorFieldContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ErrorFieldContract.FromJson(__u) )) ))() : null : Detail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayCertificateAuthorityCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayCertificateAuthorityCollection.cs new file mode 100644 index 000000000000..978504bd99f7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayCertificateAuthorityCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayCertificateAuthorityCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayCertificateAuthorityCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayCertificateAuthorityContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayCertificateAuthorityContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayCertificateAuthorityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayCertificateAuthorityContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayCertificateAuthorityCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayCertificateAuthorityCollection.json.cs new file mode 100644 index 000000000000..e9cafb5449bc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayCertificateAuthorityCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayCertificateAuthorityCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayCertificateAuthorityContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayCertificateAuthorityContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayCertificateAuthorityContract.cs new file mode 100644 index 000000000000..2484d3de8928 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway certificate authority details. + public partial class GatewayCertificateAuthorityContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayCertificateAuthorityContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayCertificateAuthorityContractPropertiesInternal)Property).IsTrusted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayCertificateAuthorityContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayCertificateAuthorityContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IGatewayCertificateAuthorityContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IGatewayCertificateAuthorityContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayCertificateAuthorityContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayCertificateAuthorityContract.json.cs new file mode 100644 index 000000000000..cb8a75dc4be0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayCertificateAuthorityContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayCertificateAuthorityContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GatewayCertificateAuthorityContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayCertificateAuthorityContractProperties.cs new file mode 100644 index 000000000000..067577d22adc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway certificate authority details. + public partial class GatewayCertificateAuthorityContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayCertificateAuthorityContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayCertificateAuthorityContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayCertificateAuthorityContractProperties.json.cs new file mode 100644 index 000000000000..baac69baa2eb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayCertificateAuthorityContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayCertificateAuthorityContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayCollection.cs new file mode 100644 index 000000000000..ed9b45adb728 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Gateway list representation. + public partial class GatewayCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayCollection.json.cs new file mode 100644 index 000000000000..9ae74e73af8a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayContract.cs new file mode 100644 index 000000000000..a32388e5d856 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway details. + public partial class GatewayContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayContractPropertiesInternal)Property).LocationDataCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayContractPropertiesInternal)Property).LocationDataCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayContractPropertiesInternal)Property).LocationDataDistrict; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayContractPropertiesInternal)Property).LocationDataName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResourceLocationDataContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContractInternal.LocationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContractPropertiesInternal)Property).LocationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContractPropertiesInternal)Property).LocationData = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayContractProperties _property; + + /// Gateway details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IGatewayContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayContract.json.cs new file mode 100644 index 000000000000..87ba190b196a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GatewayContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayContractProperties.cs new file mode 100644 index 000000000000..9e60a6b79790 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the Gateway contract. + public partial class GatewayContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResourceLocationDataContract _locationData; + + /// Gateway location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceLocationDataContract LocationData { get => (this._locationData = this._locationData ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResourceLocationDataContractInternal)LocationData).City; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResourceLocationDataContractInternal)LocationData).CountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResourceLocationDataContractInternal)LocationData).District; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResourceLocationDataContractInternal)LocationData).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceLocationDataContractInternal)LocationData).Name = value ?? null; } + + /// Internal Acessors for LocationData + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceLocationDataContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContractPropertiesInternal.LocationData { get => (this._locationData = this._locationData ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GatewayContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayContractProperties.json.cs new file mode 100644 index 000000000000..4b115160c181 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GatewayHostnameConfigurationCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayHostnameConfigurationCollection.cs new file mode 100644 index 000000000000..8ebc9de5518c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayHostnameConfigurationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayHostnameConfigurationCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayHostnameConfigurationCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayHostnameConfigurationContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayHostnameConfigurationCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayHostnameConfigurationCollection.json.cs new file mode 100644 index 000000000000..ab2979c062d5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayHostnameConfigurationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayHostnameConfigurationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayHostnameConfigurationContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayHostnameConfigurationContract.cs new file mode 100644 index 000000000000..1d29d733b251 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway hostname configuration details. + public partial class GatewayHostnameConfigurationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayHostnameConfigurationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContractPropertiesInternal)Property).CertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Hostname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Http2Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayHostnameConfigurationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContractPropertiesInternal)Property).NegotiateClientCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayHostnameConfigurationContractPropertiesInternal)Property).NegotiateClientCertificate = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Tls10Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Tls11Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GatewayHostnameConfigurationContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayHostnameConfigurationContract.json.cs new file mode 100644 index 000000000000..2a92f669d3e3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayHostnameConfigurationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayHostnameConfigurationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GatewayHostnameConfigurationContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayHostnameConfigurationContractProperties.cs new file mode 100644 index 000000000000..25036031a3d9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway hostname configuration details. + public partial class GatewayHostnameConfigurationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayHostnameConfigurationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayHostnameConfigurationContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayHostnameConfigurationContractProperties.json.cs new file mode 100644 index 000000000000..d4f6f3152a21 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayHostnameConfigurationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayHostnameConfigurationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayKeyRegenerationRequestContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayKeyRegenerationRequestContract.cs new file mode 100644 index 000000000000..543f4ff861ec --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayKeyRegenerationRequestContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayKeyRegenerationRequestContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayKeyRegenerationRequestContract.json.cs new file mode 100644 index 000000000000..01e097004cca --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayKeyRegenerationRequestContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayKeyRegenerationRequestContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayKeysContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayKeysContract.cs new file mode 100644 index 000000000000..f3043de806ee --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway authentication keys. + public partial class GatewayKeysContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayKeysContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GatewayKeysContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayKeysContract.json.cs new file mode 100644 index 000000000000..1013e4266ff5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayKeysContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayKeysContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayTokenContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayTokenContract.cs new file mode 100644 index 000000000000..0636e15df5a9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway access token. + public partial class GatewayTokenContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayTokenContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayTokenContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayTokenContract.json.cs new file mode 100644 index 000000000000..486604dd564f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayTokenContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayTokenContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayTokenRequestContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayTokenRequestContract.cs new file mode 100644 index 000000000000..5d1581ed632c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway token request contract properties. + public partial class GatewayTokenRequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayTokenRequestContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GatewayTokenRequestContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GatewayTokenRequestContract.json.cs new file mode 100644 index 000000000000..9dbb6916fe5e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGatewayTokenRequestContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGatewayTokenRequestContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GenerateSsoUrlResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GenerateSsoUrlResult.cs new file mode 100644 index 000000000000..42c1291e91e4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGenerateSsoUrlResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GenerateSsoUrlResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GenerateSsoUrlResult.json.cs new file mode 100644 index 000000000000..b470b5b55b74 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGenerateSsoUrlResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGenerateSsoUrlResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GlobalSchemaCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GlobalSchemaCollection.cs new file mode 100644 index 000000000000..7e0d9d0b089b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGlobalSchemaCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGlobalSchemaCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGlobalSchemaContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IGlobalSchemaContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGlobalSchemaContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/GlobalSchemaCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GlobalSchemaCollection.json.cs new file mode 100644 index 000000000000..1b308057e579 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGlobalSchemaCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGlobalSchemaCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGlobalSchemaContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GlobalSchemaContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GlobalSchemaContract.cs new file mode 100644 index 000000000000..2255fd1c1ba5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/GlobalSchemaContract.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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Global Schema Contract details. + public partial class GlobalSchemaContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGlobalSchemaContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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(); + + /// 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.Api20220801.IGlobalSchemaContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGlobalSchemaContractPropertiesInternal)Property).Document; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + + /// 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.Api20220801.IGlobalSchemaContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGlobalSchemaContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.GlobalSchemaContractProperties()); 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.Api20220801.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.Api20220801.IGlobalSchemaContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.GlobalSchemaContractProperties()); set => this._property = value; } + + /// 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.Api20220801.IGlobalSchemaContractPropertiesInternal)Property).SchemaType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGlobalSchemaContractPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGlobalSchemaContractInternal)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); + } + } + /// Global Schema Contract details. + public partial interface IGlobalSchemaContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// 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; } + /// 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 + { + /// 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; } + /// Properties of the Global Schema. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGlobalSchemaContractProperties Property { 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/generated/api/Models/Api20220801/GlobalSchemaContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GlobalSchemaContract.json.cs new file mode 100644 index 000000000000..879df03be7a7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGlobalSchemaContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGlobalSchemaContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GlobalSchemaContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GlobalSchemaContractProperties.cs new file mode 100644 index 000000000000..3688a090184c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/GlobalSchemaContractProperties.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.Api20220801 +{ + 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.Api20220801.IGlobalSchemaContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + + /// 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; } + /// 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; } + /// 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/generated/api/Models/Api20220801/GlobalSchemaContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GlobalSchemaContractProperties.json.cs new file mode 100644 index 000000000000..ec13e0f458d1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/GlobalSchemaContractProperties.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.Api20220801 +{ + 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.Api20220801.IGlobalSchemaContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGlobalSchemaContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode 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 ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupCollection.cs new file mode 100644 index 000000000000..5d8f52ce8ec3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Group list representation. + public partial class GroupCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupCollection.json.cs new file mode 100644 index 000000000000..56ba14e7c9a6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGroupCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GroupContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupContract.cs new file mode 100644 index 000000000000..a3f5887a243b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Contract details. + public partial class GroupContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IGroupContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContractPropertiesInternal)Property).ExternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContractInternal.BuiltIn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupContractPropertiesInternal)Property).BuiltIn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupContractPropertiesInternal)Property).BuiltIn = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContractPropertiesInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupContractPropertiesInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IGroupContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupContract.json.cs new file mode 100644 index 000000000000..b40c755eafa9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGroupContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GroupContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupContractProperties.cs new file mode 100644 index 000000000000..ab32b69ecebc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Group contract Properties. + public partial class GroupContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GroupContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupContractProperties.json.cs new file mode 100644 index 000000000000..a6c23d08f116 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGroupContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GroupCreateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupCreateParameters.cs new file mode 100644 index 000000000000..00e63ac00e40 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGroupCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupCreateParametersPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupCreateParametersPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupCreateParametersPropertiesInternal)Property).ExternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupCreateParametersPropertiesInternal)Property).ExternalId = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupCreateParametersProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.GroupCreateParametersProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupCreateParametersProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupCreateParametersPropertiesInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GroupCreateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupCreateParameters.json.cs new file mode 100644 index 000000000000..61975716bc5b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGroupCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GroupCreateParametersProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupCreateParametersProperties.cs new file mode 100644 index 000000000000..840bab403393 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGroupCreateParametersProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GroupCreateParametersProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupCreateParametersProperties.json.cs new file mode 100644 index 000000000000..e5264323298a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGroupCreateParametersProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupCreateParametersProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GroupUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupUpdateParameters.cs new file mode 100644 index 000000000000..6302169f680a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGroupUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupUpdateParametersPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupUpdateParametersPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupUpdateParametersPropertiesInternal)Property).ExternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupUpdateParametersPropertiesInternal)Property).ExternalId = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupUpdateParametersProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.GroupUpdateParametersProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupUpdateParametersProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupUpdateParametersPropertiesInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GroupUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupUpdateParameters.json.cs new file mode 100644 index 000000000000..84d2db662589 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGroupUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/GroupUpdateParametersProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupUpdateParametersProperties.cs new file mode 100644 index 000000000000..547279d9da2a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGroupUpdateParametersProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/GroupUpdateParametersProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/GroupUpdateParametersProperties.json.cs new file mode 100644 index 000000000000..e59fefc102cd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IGroupUpdateParametersProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IGroupUpdateParametersProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/HostnameConfiguration.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/HostnameConfiguration.cs new file mode 100644 index 000000000000..c7a7d3a05f65 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Custom hostname configuration. + public partial class HostnameConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHostnameConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHostnameConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateInformation _certificate; + + /// Certificate information. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ICertificateInformation Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateInformationInternal)Certificate).Expiry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateInformationInternal)Certificate).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateInformationInternal)Certificate).Thumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ICertificateInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHostnameConfigurationInternal.Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/HostnameConfiguration.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/HostnameConfiguration.json.cs new file mode 100644 index 000000000000..1118bef10088 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IHostnameConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHostnameConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/HttpHeader.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/HttpHeader.cs new file mode 100644 index 000000000000..da97492c8f72 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IHttpHeader, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/HttpHeader.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/HttpHeader.json.cs new file mode 100644 index 000000000000..1c3a0b08d0ed --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IHttpHeader. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpHeader. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/HttpMessageDiagnostic.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/HttpMessageDiagnostic.cs new file mode 100644 index 000000000000..1aee2cd8c65a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Http message diagnostic settings. + public partial class HttpMessageDiagnostic : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBodyDiagnosticSettings Body { get => (this._body = this._body ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBodyDiagnosticSettingsInternal)Body).Byte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettingsInternal)Body).Byte = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMasking DataMasking { get => (this._dataMasking = this._dataMasking ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] DataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingInternal)DataMasking).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] DataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingInternal)DataMasking).QueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal.Body { get => (this._body = this._body ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.BodyDiagnosticSettings()); set { {_body = value;} } } + + /// Internal Acessors for DataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal.DataMasking { get => (this._dataMasking = this._dataMasking ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IBodyDiagnosticSettings Body { get; set; } + /// Number of request body bytes to log. + int? BodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking DataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] DataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/HttpMessageDiagnostic.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/HttpMessageDiagnostic.json.cs new file mode 100644 index 000000000000..2be81322f8f2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IHttpMessageDiagnostic. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.BodyDiagnosticSettings.FromJson(__jsonBody) : Body;} + {_dataMasking = If( json?.PropertyT("dataMasking"), out var __jsonDataMasking) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderBaseParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderBaseParameters.cs new file mode 100644 index 000000000000..88499fe36af9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Identity Provider Base Parameter Properties. + public partial class IdentityProviderBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderBaseParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderBaseParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderBaseParameters.json.cs new file mode 100644 index 000000000000..0ba5a1995847 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderBaseParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderBaseParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderContract.cs new file mode 100644 index 000000000000..2cb5309c9bd5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Identity Provider details. + public partial class IdentityProviderContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderBaseParametersInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderContract.json.cs new file mode 100644 index 000000000000..104f9bf746c5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderContractProperties.cs new file mode 100644 index 000000000000..f6161041dd83 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderBaseParameters __identityProviderBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderContractProperties.json.cs new file mode 100644 index 000000000000..1aa762434e91 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderCreateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderCreateContract.cs new file mode 100644 index 000000000000..ab1d130b66b5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Identity Provider details. + public partial class IdentityProviderCreateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderCreateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderCreateContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderCreateContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderCreateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderCreateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderBaseParametersInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderCreateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderCreateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderCreateContract.json.cs new file mode 100644 index 000000000000..52c35efd2f71 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderCreateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderCreateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderCreateContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderCreateContractProperties.cs new file mode 100644 index 000000000000..209b60c78f0c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderCreateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderCreateContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderBaseParameters __identityProviderBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderCreateContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderCreateContractProperties.json.cs new file mode 100644 index 000000000000..f46b7f00de56 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderCreateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderCreateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderList.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderList.cs new file mode 100644 index 000000000000..a36ab9a25993 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderList, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IIdentityProviderContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderList.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderList.json.cs new file mode 100644 index 000000000000..6b73b5185126 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderUpdateParameters.cs new file mode 100644 index 000000000000..391bb2863426 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderUpdatePropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderUpdatePropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderUpdatePropertiesInternal)Property).ClientSecret = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderBaseParametersInternal)Property).ProfileEditingPolicyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderUpdateParameters.json.cs new file mode 100644 index 000000000000..8486c8c61616 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderUpdateProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderUpdateProperties.cs new file mode 100644 index 000000000000..d05ae2acd5f9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderUpdatePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderBaseParameters __identityProviderBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IdentityProviderUpdateProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IdentityProviderUpdateProperties.json.cs new file mode 100644 index 000000000000..bd4cd31cb7b1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIdentityProviderUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIdentityProviderUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueAttachmentCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueAttachmentCollection.cs new file mode 100644 index 000000000000..2104429c941c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Issue Attachment list representation. + public partial class IssueAttachmentCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueAttachmentCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueAttachmentCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueAttachmentContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IIssueAttachmentContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueAttachmentContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueAttachmentCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueAttachmentCollection.json.cs new file mode 100644 index 000000000000..6a196412d2eb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueAttachmentCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueAttachmentCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueAttachmentContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IssueAttachmentContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueAttachmentContract.cs new file mode 100644 index 000000000000..4882df34bcfc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Attachment Contract details. + public partial class IssueAttachmentContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueAttachmentContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueAttachmentContractPropertiesInternal)Property).Content; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueAttachmentContractPropertiesInternal)Property).ContentFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueAttachmentContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueAttachmentContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IIssueAttachmentContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueAttachmentContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueAttachmentContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueAttachmentContract.json.cs new file mode 100644 index 000000000000..17623818cecd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueAttachmentContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueAttachmentContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueAttachmentContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueAttachmentContractProperties.cs new file mode 100644 index 000000000000..292651fe0df8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Attachment contract Properties. + public partial class IssueAttachmentContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueAttachmentContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IssueAttachmentContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueAttachmentContractProperties.json.cs new file mode 100644 index 000000000000..293b29317212 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueAttachmentContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueAttachmentContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IssueCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueCollection.cs new file mode 100644 index 000000000000..d784bb91fa50 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Issue list representation. + public partial class IssueCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContract[] _value; + + /// Issue values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueCollection.json.cs new file mode 100644 index 000000000000..1855df3f9d72 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IssueCommentCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueCommentCollection.cs new file mode 100644 index 000000000000..b45eeb80f70e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Issue Comment list representation. + public partial class IssueCommentCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueCommentCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueCommentCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueCommentContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IIssueCommentContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueCommentContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueCommentCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueCommentCollection.json.cs new file mode 100644 index 000000000000..181c8bf25770 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueCommentCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueCommentCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueCommentContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IssueCommentContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueCommentContract.cs new file mode 100644 index 000000000000..1df6bdc413d8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Comment Contract details. + public partial class IssueCommentContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueCommentContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueCommentContractPropertiesInternal)Property).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueCommentContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueCommentContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IIssueCommentContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueCommentContractPropertiesInternal)Property).Text; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueCommentContractPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueCommentContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueCommentContract.json.cs new file mode 100644 index 000000000000..855538d65b3d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueCommentContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueCommentContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueCommentContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueCommentContractProperties.cs new file mode 100644 index 000000000000..a612370548a2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Comment contract Properties. + public partial class IssueCommentContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueCommentContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IssueCommentContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueCommentContractProperties.json.cs new file mode 100644 index 000000000000..c7341d59dab0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueCommentContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueCommentContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IssueContext.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueContext.cs new file mode 100644 index 000000000000..ea583d1b80b7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueContext, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IssueContext.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueContext.dictionary.cs new file mode 100644 index 000000000000..34417e608f96 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IssueContext source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueContext.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueContext.json.cs new file mode 100644 index 000000000000..4c961f255587 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueContext. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContext. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IssueContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueContract.cs new file mode 100644 index 000000000000..cfaa2e3bd1ea --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Contract details. + public partial class IssueContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)Property).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)Property).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IIssueContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueContract.json.cs new file mode 100644 index 000000000000..8df755730cdb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueContractBaseProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueContractBaseProperties.cs new file mode 100644 index 000000000000..a14739528f44 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Base Properties. + public partial class IssueContractBaseProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContractBaseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IssueContractBaseProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueContractBaseProperties.json.cs new file mode 100644 index 000000000000..aae96177bd10 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueContractBaseProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContractBaseProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/IssueContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueContractProperties.cs new file mode 100644 index 000000000000..3545a68af40c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Properties. + public partial class IssueContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContractBaseProperties __issueContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueContractProperties.json.cs new file mode 100644 index 000000000000..1f60d025d9ca --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueUpdateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueUpdateContract.cs new file mode 100644 index 000000000000..75ef54b56d38 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue update Parameters. + public partial class IssueUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)Property).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)Property).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueUpdateContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueUpdateContractPropertiesInternal)Property).Description = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueUpdateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IssueUpdateContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueUpdateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueUpdateContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueUpdateContractPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueUpdateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueUpdateContract.json.cs new file mode 100644 index 000000000000..6e3bcf81213c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueUpdateContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueUpdateContractProperties.cs new file mode 100644 index 000000000000..04598643b200 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Update Properties. + public partial class IssueUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueUpdateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueUpdateContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueContractBaseProperties __issueContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/IssueUpdateContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/IssueUpdateContractProperties.json.cs new file mode 100644 index 000000000000..82b9740451b9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IIssueUpdateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IIssueUpdateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/KeyVaultContractCreateProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/KeyVaultContractCreateProperties.cs new file mode 100644 index 000000000000..9dd4eda17684 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Create keyVault contract details. + public partial class KeyVaultContractCreateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/KeyVaultContractCreateProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/KeyVaultContractCreateProperties.json.cs new file mode 100644 index 000000000000..683c96c81b35 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IKeyVaultContractCreateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/KeyVaultContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/KeyVaultContractProperties.cs new file mode 100644 index 000000000000..a5e85d3ac518 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// KeyVault contract details. + public partial class KeyVaultContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreateProperties __keyVaultContractCreateProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)__keyVaultContractCreateProperties).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreatePropertiesInternal)__keyVaultContractCreateProperties).IdentityClientId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultLastAccessStatusContractProperties LastStatus { get => (this._lastStatus = this._lastStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultLastAccessStatusContractPropertiesInternal)LastStatus).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultLastAccessStatusContractPropertiesInternal)LastStatus).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultLastAccessStatusContractPropertiesInternal)LastStatus).TimeStampUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultLastAccessStatusContractPropertiesInternal)LastStatus).TimeStampUtc = value ?? default(global::System.DateTime); } + + /// Internal Acessors for LastStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultLastAccessStatusContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractPropertiesInternal.LastStatus { get => (this._lastStatus = this._lastStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)__keyVaultContractCreateProperties).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal + { + /// Last time sync and refresh status of secret from key vault. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/KeyVaultContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/KeyVaultContractProperties.json.cs new file mode 100644 index 000000000000..25d43d733035 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IKeyVaultContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.KeyVaultContractCreateProperties(json); + {_lastStatus = If( json?.PropertyT("lastStatus"), out var __jsonLastStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/KeyVaultLastAccessStatusContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/KeyVaultLastAccessStatusContractProperties.cs new file mode 100644 index 000000000000..31178b123b7b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Update Properties. + public partial class KeyVaultLastAccessStatusContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultLastAccessStatusContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/KeyVaultLastAccessStatusContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/KeyVaultLastAccessStatusContractProperties.json.cs new file mode 100644 index 000000000000..13c58141caea --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IKeyVaultLastAccessStatusContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultLastAccessStatusContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/LoggerCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerCollection.cs new file mode 100644 index 000000000000..dd3c510d2c98 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Logger list representation. + public partial class LoggerCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContract[] _value; + + /// Logger values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerCollection.json.cs new file mode 100644 index 000000000000..56782e12cdc0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ILoggerCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/LoggerContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerContract.cs new file mode 100644 index 000000000000..8bed21adfaed --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Logger details. + public partial class LoggerContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContractPropertiesCredentials Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerContractPropertiesInternal)Property).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContractPropertiesInternal)Property).IsBuffered; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContractPropertiesInternal)Property).LoggerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ILoggerContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContractPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ILoggerContractPropertiesCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/LoggerContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerContract.json.cs new file mode 100644 index 000000000000..4c36d0cff070 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ILoggerContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/LoggerContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerContractProperties.cs new file mode 100644 index 000000000000..8a2da38f4f44 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ILoggerContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContractPropertiesCredentials Credentials { get => (this._credentials = this._credentials ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerContractPropertiesCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/LoggerContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerContractProperties.json.cs new file mode 100644 index 000000000000..4c6165a354ea --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ILoggerContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/LoggerContractPropertiesCredentials.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerContractPropertiesCredentials.cs new file mode 100644 index 000000000000..9c4a55d58f83 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ILoggerContractPropertiesCredentials, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/LoggerContractPropertiesCredentials.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerContractPropertiesCredentials.dictionary.cs new file mode 100644 index 000000000000..db84bfeae8cb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.LoggerContractPropertiesCredentials source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerContractPropertiesCredentials.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerContractPropertiesCredentials.json.cs new file mode 100644 index 000000000000..182e85b71b09 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ILoggerContractPropertiesCredentials. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerContractPropertiesCredentials. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/LoggerUpdateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerUpdateContract.cs new file mode 100644 index 000000000000..ab03a5caf622 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Logger update contract. + public partial class LoggerUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateContractInternal + { + + /// Logger credentials. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateParametersCredentials Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateParametersInternal)Property).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerUpdateParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerUpdateParametersInternal)Property).IsBuffered; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerUpdateParametersInternal)Property).LoggerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateParametersInternal)Property).LoggerType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType)""); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateParameters Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.LoggerUpdateParameters()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerUpdateParameters Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerUpdateParametersCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ILoggerUpdateParameters Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerUpdateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerUpdateContract.json.cs new file mode 100644 index 000000000000..694897d7c948 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ILoggerUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/LoggerUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerUpdateParameters.cs new file mode 100644 index 000000000000..11208e62abc4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ILoggerUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateParametersCredentials _credentials; + + /// Logger credentials. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateParametersCredentials Credentials { get => (this._credentials = this._credentials ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ILoggerUpdateParametersCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/LoggerUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerUpdateParameters.json.cs new file mode 100644 index 000000000000..c84f4f1c6b12 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ILoggerUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/LoggerUpdateParametersCredentials.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerUpdateParametersCredentials.cs new file mode 100644 index 000000000000..652bd1e1750c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Logger credentials. + public partial class LoggerUpdateParametersCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateParametersCredentials, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/LoggerUpdateParametersCredentials.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerUpdateParametersCredentials.dictionary.cs new file mode 100644 index 000000000000..c3813af5a6f1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.LoggerUpdateParametersCredentials source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerUpdateParametersCredentials.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/LoggerUpdateParametersCredentials.json.cs new file mode 100644 index 000000000000..10042fd429f0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ILoggerUpdateParametersCredentials. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ILoggerUpdateParametersCredentials. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/NamedValueCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueCollection.cs new file mode 100644 index 000000000000..f046645363ad --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged NamedValue list representation. + public partial class NamedValueCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueCollection.json.cs new file mode 100644 index 000000000000..b9a1ca6e1596 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INamedValueCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/NamedValueContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueContract.cs new file mode 100644 index 000000000000..d24e5b30c3d4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueContract.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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue details. + public partial class NamedValueContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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(); + + /// + /// 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.Api20220801.INamedValueContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueContractPropertiesInternal)Property).KeyVaultIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueContractPropertiesInternal)Property).KeyVaultSecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueContractPropertiesInternal)Property).LastStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueContractPropertiesInternal)Property).LastStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueContractPropertiesInternal)Property).LastStatusTimeStampUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractPropertiesInternal)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.Api20220801.IKeyVaultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractInternal.KeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractPropertiesInternal)Property).KeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractPropertiesInternal)Property).KeyVault = value; } + + /// Internal Acessors for KeyVaultLastStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultLastAccessStatusContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractInternal.KeyVaultLastStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractPropertiesInternal)Property).KeyVaultLastStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractPropertiesInternal)Property).KeyVaultLastStatus = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.NamedValueContractProperties()); 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.Api20220801.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.Api20220801.INamedValueContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.NamedValueContractProperties()); 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.Api20220801.INamedValueEntityBaseParametersInternal)Property).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueEntityBaseParametersInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueContractPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (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 + { + /// + /// 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; } + /// + /// 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 + { + /// + /// 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.Api20220801.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.Api20220801.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; } + /// NamedValue entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractProperties 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/generated/api/Models/Api20220801/NamedValueContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueContract.json.cs new file mode 100644 index 000000000000..5c0bd65ab37c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INamedValueContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NamedValueContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueContractProperties.cs new file mode 100644 index 000000000000..8f92b7b6b340 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueContractProperties.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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Contract properties. + public partial class NamedValueContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueEntityBaseParameters __namedValueEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IKeyVaultContractProperties KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusTimeStampUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusTimeStampUtc = value ?? default(global::System.DateTime); } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractPropertiesInternal.KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.KeyVaultContractProperties()); set { {_keyVault = value;} } } + + /// Internal Acessors for KeyVaultLastStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultLastAccessStatusContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractPropertiesInternal.KeyVaultLastStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractPropertiesInternal)KeyVault).LastStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractPropertiesInternal)KeyVault).LastStatus = 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.Api20220801.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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; } + /// + /// 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.Api20220801.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.Api20220801.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.Api20220801.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; } + /// + /// 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/generated/api/Models/Api20220801/NamedValueContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueContractProperties.json.cs new file mode 100644 index 000000000000..46df42db1228 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueContractProperties.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.Api20220801 +{ + 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.Api20220801.INamedValueContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.NamedValueEntityBaseParameters(json); + {_keyVault = If( json?.PropertyT("keyVault"), out var __jsonKeyVault) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode 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/generated/api/Models/Api20220801/NamedValueCreateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueCreateContract.cs new file mode 100644 index 000000000000..76d74f20b927 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue details. + public partial class NamedValueCreateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCreateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueCreateContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueCreateContractPropertiesInternal)Property).KeyVaultIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueCreateContractPropertiesInternal)Property).KeyVaultSecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCreateContractInternal.KeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCreateContractPropertiesInternal)Property).KeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCreateContractPropertiesInternal)Property).KeyVault = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCreateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCreateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.INamedValueCreateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueEntityBaseParametersInternal)Property).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueEntityBaseParametersInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueCreateContractPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NamedValueCreateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueCreateContract.json.cs new file mode 100644 index 000000000000..fe117cc6a3bf --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INamedValueCreateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCreateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NamedValueCreateContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueCreateContractProperties.cs new file mode 100644 index 000000000000..1b71441e8cc2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Contract properties. + public partial class NamedValueCreateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCreateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCreateContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueEntityBaseParameters __namedValueEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IKeyVaultContractCreateProperties KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier = value ?? null; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCreateContractPropertiesInternal.KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NamedValueCreateContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueCreateContractProperties.json.cs new file mode 100644 index 000000000000..35597ba0636b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INamedValueCreateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueCreateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.NamedValueEntityBaseParameters(json); + {_keyVault = If( json?.PropertyT("keyVault"), out var __jsonKeyVault) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/NamedValueEntityBaseParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueEntityBaseParameters.cs new file mode 100644 index 000000000000..26acaf9fba7a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Entity Base Parameters set. + public partial class NamedValueEntityBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueEntityBaseParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/NamedValueEntityBaseParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueEntityBaseParameters.json.cs new file mode 100644 index 000000000000..c3923eca5085 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INamedValueEntityBaseParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueEntityBaseParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/NamedValueSecretContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueSecretContract.cs new file mode 100644 index 000000000000..bbb4b1c15b63 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INamedValueSecretContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NamedValueSecretContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueSecretContract.json.cs new file mode 100644 index 000000000000..b44d53c3209d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INamedValueSecretContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueSecretContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/NamedValueUpdateParameterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueUpdateParameterProperties.cs new file mode 100644 index 000000000000..090ab992a46f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Contract properties. + public partial class NamedValueUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParameterPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueEntityBaseParameters __namedValueEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IKeyVaultContractCreateProperties KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier = value ?? null; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParameterPropertiesInternal.KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NamedValueUpdateParameterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..28e0e91e53cc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INamedValueUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.NamedValueEntityBaseParameters(json); + {_keyVault = If( json?.PropertyT("keyVault"), out var __jsonKeyVault) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/NamedValueUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueUpdateParameters.cs new file mode 100644 index 000000000000..dcc33a530992 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue update Parameters. + public partial class NamedValueUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueUpdateParameterPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueUpdateParameterPropertiesInternal)Property).KeyVaultIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueUpdateParameterPropertiesInternal)Property).KeyVaultSecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParameterPropertiesInternal)Property).KeyVaultSecretIdentifier = value ?? null; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParametersInternal.KeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParameterPropertiesInternal)Property).KeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParameterPropertiesInternal)Property).KeyVault = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.NamedValueUpdateParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueEntityBaseParametersInternal)Property).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueEntityBaseParametersInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INamedValueUpdateParameterPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NamedValueUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NamedValueUpdateParameters.json.cs new file mode 100644 index 000000000000..dce4de24bd99 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INamedValueUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INamedValueUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NetworkStatusContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NetworkStatusContract.cs new file mode 100644 index 000000000000..205601592609 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Network Status details. + public partial class NetworkStatusContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INetworkStatusContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INetworkStatusContractInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IConnectivityStatusContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NetworkStatusContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NetworkStatusContract.json.cs new file mode 100644 index 000000000000..3141813bb429 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INetworkStatusContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INetworkStatusContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityStatusContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/NetworkStatusContractByLocation.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NetworkStatusContractByLocation.cs new file mode 100644 index 000000000000..69edbd769b77 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Network Status in the Location + public partial class NetworkStatusContractByLocation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INetworkStatusContractByLocation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INetworkStatusContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INetworkStatusContractByLocationInternal.NetworkStatus { get => (this._networkStatus = this._networkStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.NetworkStatusContract()); set { {_networkStatus = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INetworkStatusContract NetworkStatus { get => (this._networkStatus = this._networkStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityStatusContract[] NetworkStatusConnectivityStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INetworkStatusContractInternal)NetworkStatus).ConnectivityStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INetworkStatusContractInternal)NetworkStatus).DnsServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IConnectivityStatusContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NetworkStatusContractByLocation.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NetworkStatusContractByLocation.json.cs new file mode 100644 index 000000000000..dcbcb28a3b36 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INetworkStatusContractByLocation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INetworkStatusContractByLocation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NotificationCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NotificationCollection.cs new file mode 100644 index 000000000000..fae2b76bd76a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Notification list representation. + public partial class NotificationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INotificationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INotificationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INotificationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INotificationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/NotificationCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NotificationCollection.json.cs new file mode 100644 index 000000000000..b9ec9aa79444 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INotificationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INotificationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INotificationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/NotificationContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NotificationContract.cs new file mode 100644 index 000000000000..503c2ddc8bc9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Notification details. + public partial class NotificationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INotificationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INotificationContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INotificationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INotificationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.NotificationContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Recipient + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientsContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INotificationContractInternal.Recipient { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INotificationContractPropertiesInternal)Property).Recipient; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.INotificationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INotificationContractPropertiesInternal)Property).RecipientEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INotificationContractPropertiesInternal)Property).RecipientUser; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INotificationContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.INotificationContractProperties Property { get; set; } + /// Recipient Parameter values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/NotificationContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NotificationContract.json.cs new file mode 100644 index 000000000000..3c2fd0efedec --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INotificationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INotificationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NotificationContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NotificationContractProperties.cs new file mode 100644 index 000000000000..11e7d9dc2233 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Notification Contract properties. + public partial class NotificationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INotificationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientsContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INotificationContractPropertiesInternal.Recipient { get => (this._recipient = this._recipient ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.RecipientsContractProperties()); set { {_recipient = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientsContractProperties Recipient { get => (this._recipient = this._recipient ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientsContractPropertiesInternal)Recipient).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientsContractPropertiesInternal)Recipient).User; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/NotificationContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/NotificationContractProperties.json.cs new file mode 100644 index 000000000000..b4b017553bfb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.INotificationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.INotificationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OAuth2AuthenticationSettingsContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OAuth2AuthenticationSettingsContract.cs new file mode 100644 index 000000000000..2cb80a5736b0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API OAuth2 Authentication settings details. + public partial class OAuth2AuthenticationSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OAuth2AuthenticationSettingsContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OAuth2AuthenticationSettingsContract.json.cs new file mode 100644 index 000000000000..1df277aa7f99 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOAuth2AuthenticationSettingsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOAuth2AuthenticationSettingsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OpenIdAuthenticationSettingsContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenIdAuthenticationSettingsContract.cs new file mode 100644 index 000000000000..1acfeeb557e6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API OAuth2 Authentication settings details. + public partial class OpenIdAuthenticationSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OpenIdAuthenticationSettingsContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenIdAuthenticationSettingsContract.json.cs new file mode 100644 index 000000000000..ed4de41e686c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOpenIdAuthenticationSettingsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdAuthenticationSettingsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OpenIdConnectProviderCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenIdConnectProviderCollection.cs new file mode 100644 index 000000000000..fd9e8dbbb9b1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged OpenIdProviders list representation. + public partial class OpenIdConnectProviderCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdConnectProviderCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenIdConnectProviderCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenIdConnectProviderCollection.json.cs new file mode 100644 index 000000000000..9d73520c7832 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOpenIdConnectProviderCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenIdConnectProviderCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OpenidConnectProviderContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenidConnectProviderContract.cs new file mode 100644 index 000000000000..3d9b86121239 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OpenId Connect Provider details. + public partial class OpenidConnectProviderContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenidConnectProviderContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContractPropertiesInternal)Property).MetadataEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenidConnectProviderContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IOpenidConnectProviderContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContractPropertiesInternal)Property).UseInApiDocumentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderContractPropertiesInternal)Property).UseInTestConsole; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OpenidConnectProviderContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenidConnectProviderContract.json.cs new file mode 100644 index 000000000000..e367130b4bd4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOpenidConnectProviderContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenidConnectProviderContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OpenidConnectProviderContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenidConnectProviderContractProperties.cs new file mode 100644 index 000000000000..685b56f12dbb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OpenID Connect Providers Contract. + public partial class OpenidConnectProviderContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenidConnectProviderContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OpenidConnectProviderContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenidConnectProviderContractProperties.json.cs new file mode 100644 index 000000000000..b0e18d7334bc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOpenidConnectProviderContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenidConnectProviderContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OpenidConnectProviderUpdateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenidConnectProviderUpdateContract.cs new file mode 100644 index 000000000000..beffb3d41f70 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOpenidConnectProviderUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).MetadataEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).MetadataEndpoint = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenidConnectProviderUpdateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenidConnectProviderUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.OpenidConnectProviderUpdateContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderUpdateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).UseInApiDocumentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).UseInTestConsole; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OpenidConnectProviderUpdateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenidConnectProviderUpdateContract.json.cs new file mode 100644 index 000000000000..f62e585c8ac5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOpenidConnectProviderUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenidConnectProviderUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OpenidConnectProviderUpdateContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenidConnectProviderUpdateContractProperties.cs new file mode 100644 index 000000000000..fb582b2f1bf6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOpenidConnectProviderUpdateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OpenidConnectProviderUpdateContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OpenidConnectProviderUpdateContractProperties.json.cs new file mode 100644 index 000000000000..22ac6673a636 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOpenidConnectProviderUpdateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOpenidConnectProviderUpdateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/Operation.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/Operation.cs new file mode 100644 index 000000000000..1f620c35d4f0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// REST API operation + public partial class Operation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationDisplayInternal)Display).Resource = value ?? null; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/Operation.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/Operation.json.cs new file mode 100644 index 000000000000..5605a50e39a5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OperationCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationCollection.cs new file mode 100644 index 000000000000..efa59a841b6b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Operation list representation. + public partial class OperationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationCollection.json.cs new file mode 100644 index 000000000000..fc045ddcc2df --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationContract.cs new file mode 100644 index 000000000000..8c1f07fb0d9d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Operation details. + public partial class OperationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationContractPropertiesInternal)Property).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.OperationContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Request + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationContractInternal.Request { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)Property).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).Policy = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)Property).RequestDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] RequestQueryParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).RequestQueryParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract[] RequestRepresentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).RequestRepresentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResponseContract[] Response { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] TemplateParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).TemplateParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationContractPropertiesInternal)Property).UrlTemplate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResponseContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationContractProperties Property { get; set; } + /// An entity containing request details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestContract Request { get; set; } + /// Operation request description. + string RequestDescription { get; set; } + /// Collection of operation request headers. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterContract[] RequestHeader { get; set; } + /// Collection of operation request query parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterContract[] RequestQueryParameter { get; set; } + /// Collection of operation request representations. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRepresentationContract[] RequestRepresentation { get; set; } + /// Array of Operation responses. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResponseContract[] Response { get; set; } + /// Collection of URL template parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationContract.json.cs new file mode 100644 index 000000000000..1292bd958382 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OperationContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationContractProperties.cs new file mode 100644 index 000000000000..ac68a829793e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Contract Properties + public partial class OperationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContract __operationEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRequestContract Request { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] RequestQueryParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestQueryParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract[] RequestRepresentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestRepresentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResponseContract[] Response { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] TemplateParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).TemplateParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OperationContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationContractProperties.json.cs new file mode 100644 index 000000000000..10c4e8931b9d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OperationDisplay.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationDisplay.cs new file mode 100644 index 000000000000..8c2b582938c2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationDisplay.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationDisplay.json.cs new file mode 100644 index 000000000000..d9b49a495b9a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationEntityBaseContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationEntityBaseContract.cs new file mode 100644 index 000000000000..4898fc96f016 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationEntityBaseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRequestContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal.Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IRequestContract Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRequestContractInternal)Request).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestContractInternal)Request).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] RequestQueryParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestContractInternal)Request).QueryParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract[] RequestRepresentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestContractInternal)Request).Representation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestContractInternal)Request).Representation = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResponseContract[] Response { get => this._response; set => this._response = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResponseContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRequestContract Request { get; set; } + /// Operation request description. + string RequestDescription { get; set; } + /// Collection of operation request headers. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterContract[] RequestHeader { get; set; } + /// Collection of operation request query parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterContract[] RequestQueryParameter { get; set; } + /// Collection of operation request representations. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRepresentationContract[] RequestRepresentation { get; set; } + /// Array of Operation responses. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResponseContract[] Response { get; set; } + /// Collection of URL template parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterContract[] TemplateParameter { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationEntityBaseContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationEntityBaseContract.json.cs new file mode 100644 index 000000000000..d23127fc3f39 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationEntityBaseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResponseContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationListResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationListResult.cs new file mode 100644 index 000000000000..cd1aaa2a12f6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationListResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationListResult.json.cs new file mode 100644 index 000000000000..31a9f82e2dde --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationResultContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationResultContract.cs new file mode 100644 index 000000000000..0585b10bbc69 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Long Running Git Operation Results. + public partial class OperationResultContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultLogItemContract[] ActionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultContractPropertiesInternal)Property).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorFieldContract[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractPropertiesInternal)Property).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultContractPropertiesInternal)Property).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultLogItemContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractInternal.ActionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractPropertiesInternal)Property).ActionLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractPropertiesInternal)Property).ActionLog = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractPropertiesInternal)Property).Error = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractPropertiesInternal)Property).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultContractPropertiesInternal)Property).ResultInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultContractPropertiesInternal)Property).Started; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultContractPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultContractPropertiesInternal)Property).Updated; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultLogItemContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IErrorFieldContract[] Detail { get; set; } + /// Error Body Contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OperationResultContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationResultContract.json.cs new file mode 100644 index 000000000000..87fb15891e0d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationResultContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OperationResultContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationResultContractProperties.cs new file mode 100644 index 000000000000..140962a9d7fa --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Result. + public partial class OperationResultContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IErrorResponseBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorFieldContract[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorResponseBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorResponseBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for ActionLog + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultLogItemContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractPropertiesInternal.ActionLog { get => this._actionLog; set { {_actionLog = value;} } } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractPropertiesInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationResultLogItemContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IErrorFieldContract[] Detail { get; set; } + /// Error Body Contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationResultContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationResultContractProperties.json.cs new file mode 100644 index 000000000000..3ada273d3611 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationResultContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IOperationResultLogItemContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationResultLogItemContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationResultLogItemContract.cs new file mode 100644 index 000000000000..7c441f1ecc5d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationResultLogItemContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationResultLogItemContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationResultLogItemContract.json.cs new file mode 100644 index 000000000000..4ad3ea736026 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationResultLogItemContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationResultLogItemContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationTagResourceContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationTagResourceContractProperties.cs new file mode 100644 index 000000000000..7ab7c38e1cd0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Entity contract Properties. + public partial class OperationTagResourceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationTagResourceContractPropertiesInternal.ApiName { get => this._apiName; set { {_apiName = value;} } } + + /// Internal Acessors for ApiRevision + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal.ApiRevision { get => this._apiRevision; set { {_apiRevision = value;} } } + + /// Internal Acessors for ApiVersion + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal.ApiVersion { get => this._apiVersion; set { {_apiVersion = value;} } } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for Method + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal.Method { get => this._method; set { {_method = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for UrlTemplate + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationTagResourceContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationTagResourceContractProperties.json.cs new file mode 100644 index 000000000000..290aaf78e648 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationTagResourceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationUpdateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationUpdateContract.cs new file mode 100644 index 000000000000..b6355ccaf1e3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Operation Update Contract details. + public partial class OperationUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationUpdateContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationUpdateContractPropertiesInternal)Property).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationUpdateContractPropertiesInternal)Property).Method = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationUpdateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.OperationUpdateContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Request + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationUpdateContractInternal.Request { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)Property).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).Policy = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationUpdateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)Property).RequestDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] RequestQueryParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).RequestQueryParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract[] RequestRepresentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).RequestRepresentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResponseContract[] Response { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] TemplateParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)Property).TemplateParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationUpdateContractPropertiesInternal)Property).UrlTemplate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResponseContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationUpdateContractProperties Property { get; set; } + /// An entity containing request details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestContract Request { get; set; } + /// Operation request description. + string RequestDescription { get; set; } + /// Collection of operation request headers. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterContract[] RequestHeader { get; set; } + /// Collection of operation request query parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterContract[] RequestQueryParameter { get; set; } + /// Collection of operation request representations. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRepresentationContract[] RequestRepresentation { get; set; } + /// Array of Operation responses. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResponseContract[] Response { get; set; } + /// Collection of URL template parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OperationUpdateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationUpdateContract.json.cs new file mode 100644 index 000000000000..28c78df5d9cd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OperationUpdateContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationUpdateContractProperties.cs new file mode 100644 index 000000000000..99c50d3698b4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Update Contract Properties. + public partial class OperationUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationUpdateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationUpdateContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContract __operationEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRequestContract Request { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] RequestQueryParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestQueryParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract[] RequestRepresentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestRepresentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResponseContract[] Response { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] TemplateParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationEntityBaseContractInternal)__operationEntityBaseContract).TemplateParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OperationUpdateContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OperationUpdateContractProperties.json.cs new file mode 100644 index 000000000000..d91f6d66728c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOperationUpdateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationUpdateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/OutboundEnvironmentEndpoint.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OutboundEnvironmentEndpoint.cs new file mode 100644 index 000000000000..8dbc63e4ca34 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOutboundEnvironmentEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IEndpointDependency) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEndpointDependency[] Endpoint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/OutboundEnvironmentEndpoint.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OutboundEnvironmentEndpoint.json.cs new file mode 100644 index 000000000000..52bb1a91dda6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOutboundEnvironmentEndpoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOutboundEnvironmentEndpoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IEndpointDependency) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/OutboundEnvironmentEndpointList.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OutboundEnvironmentEndpointList.cs new file mode 100644 index 000000000000..2a995c469edf --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Collection of Outbound Environment Endpoints + public partial class OutboundEnvironmentEndpointList : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOutboundEnvironmentEndpointList, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOutboundEnvironmentEndpointListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IOutboundEnvironmentEndpoint) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOutboundEnvironmentEndpoint[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/OutboundEnvironmentEndpointList.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/OutboundEnvironmentEndpointList.json.cs new file mode 100644 index 000000000000..b4a081baafde --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IOutboundEnvironmentEndpointList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOutboundEnvironmentEndpointList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOutboundEnvironmentEndpoint) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ParameterContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ParameterContract.cs new file mode 100644 index 000000000000..c54aacc36c82 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation parameters details. + public partial class ParameterContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IParameterExamplesContract Example { get => (this._example = this._example ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterExamplesContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ParameterContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ParameterContract.json.cs new file mode 100644 index 000000000000..9ab888f66a71 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IParameterContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ParameterExampleContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ParameterExampleContract.cs new file mode 100644 index 000000000000..ee3d1bb101d6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameter example. + public partial class ParameterExampleContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterExampleContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ParameterExampleContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ParameterExampleContract.json.cs new file mode 100644 index 000000000000..741e436ff723 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IParameterExampleContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterExampleContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ParameterExamplesContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ParameterExamplesContract.cs new file mode 100644 index 000000000000..b762e006ec0b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameter examples. + public partial class ParameterExamplesContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterExamplesContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ParameterExamplesContract.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ParameterExamplesContract.dictionary.cs new file mode 100644 index 000000000000..416e42a11ece --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.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.Api20220801.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.Api20220801.IParameterExampleContract value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ParameterExamplesContract source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ParameterExamplesContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ParameterExamplesContract.json.cs new file mode 100644 index 000000000000..d86040efe34f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IParameterExamplesContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterExamplesContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PipelineDiagnosticSettings.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PipelineDiagnosticSettings.cs new file mode 100644 index 000000000000..3337c50864da --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPipelineDiagnosticSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal + { + + /// Internal Acessors for Request + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal.Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.HttpMessageDiagnostic()); set { {_request = value;} } } + + /// Internal Acessors for RequestBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal.RequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Request).Body; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Request).Body = value; } + + /// Internal Acessors for RequestDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal.RequestDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Request).DataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Request).DataMasking = value; } + + /// Internal Acessors for Response + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal.Response { get => (this._response = this._response ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.HttpMessageDiagnostic()); set { {_response = value;} } } + + /// Internal Acessors for ResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal.ResponseBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Response).Body; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Response).Body = value; } + + /// Internal Acessors for ResponseDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettingsInternal.ResponseDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Response).DataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Response).DataMasking = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHttpMessageDiagnostic Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHttpMessageDiagnosticInternal)Request).BodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] RequestDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Request).DataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] RequestDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Request).DataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHttpMessageDiagnosticInternal)Request).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Request).Header = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHttpMessageDiagnostic Response { get => (this._response = this._response ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHttpMessageDiagnosticInternal)Response).BodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] ResponseDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Response).DataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity[] ResponseDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnosticInternal)Response).DataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHttpMessageDiagnosticInternal)Response).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IHttpMessageDiagnostic Request { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings RequestBody { get; set; } + /// Number of request body bytes to log. + int? RequestBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking RequestDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] RequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] RequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] RequestHeader { get; set; } + /// Diagnostic settings for response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IHttpMessageDiagnostic Response { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IBodyDiagnosticSettings ResponseBody { get; set; } + /// Number of request body bytes to log. + int? ResponseBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMasking ResponseDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IDataMaskingEntity[] ResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PipelineDiagnosticSettings.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PipelineDiagnosticSettings.json.cs new file mode 100644 index 000000000000..9f82776f2430 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPipelineDiagnosticSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPipelineDiagnosticSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.HttpMessageDiagnostic.FromJson(__jsonRequest) : Request;} + {_response = If( json?.PropertyT("response"), out var __jsonResponse) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PolicyCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyCollection.cs new file mode 100644 index 000000000000..0f63abb306f2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPolicyCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IPolicyContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyCollection.json.cs new file mode 100644 index 000000000000..c7906c0cc51d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPolicyCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PolicyContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyContract.cs new file mode 100644 index 000000000000..69d7dfa75355 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy Contract details. + public partial class PolicyContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyContractPropertiesInternal)Property).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPolicyContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyContractPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PolicyContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyContract.json.cs new file mode 100644 index 000000000000..7f59fa363aaf --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPolicyContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PolicyContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyContractProperties.cs new file mode 100644 index 000000000000..cf55f3f8ee4f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy contract Properties. + public partial class PolicyContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PolicyContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyContractProperties.json.cs new file mode 100644 index 000000000000..2012815ea44a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPolicyContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PolicyDescriptionCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyDescriptionCollection.cs new file mode 100644 index 000000000000..b7382956283f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Descriptions of API Management policies. + public partial class PolicyDescriptionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IPolicyDescriptionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyDescriptionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyDescriptionCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyDescriptionCollection.json.cs new file mode 100644 index 000000000000..d14325870981 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPolicyDescriptionCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyDescriptionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PolicyDescriptionContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyDescriptionContract.cs new file mode 100644 index 000000000000..cf36070f723a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy description details. + public partial class PolicyDescriptionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPolicyDescriptionContractInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionContractPropertiesInternal)Property).Description = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PolicyDescriptionContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Scope + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionContractInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionContractPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPolicyDescriptionContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PolicyDescriptionContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyDescriptionContract.json.cs new file mode 100644 index 000000000000..5b6eabdfe6b7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPolicyDescriptionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PolicyDescriptionContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyDescriptionContractProperties.cs new file mode 100644 index 000000000000..cf78732ec5e1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy description properties. + public partial class PolicyDescriptionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyDescriptionContractPropertiesInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for Scope + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PolicyDescriptionContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyDescriptionContractProperties.json.cs new file mode 100644 index 000000000000..ea2214e17e90 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPolicyDescriptionContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyDescriptionContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PolicyFragmentCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentCollection.cs new file mode 100644 index 000000000000..5a64fe685236 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPolicyFragmentCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IPolicyFragmentContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyFragmentContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentCollection.json.cs new file mode 100644 index 000000000000..e4bdeccf57ce --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPolicyFragmentCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyFragmentCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyFragmentContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PolicyFragmentContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentContract.cs new file mode 100644 index 000000000000..730e401bba3f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentContract.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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy fragment contract details. + public partial class PolicyFragmentContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyFragmentContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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(); + + /// 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.Api20220801.IPolicyFragmentContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyFragmentContractPropertiesInternal)Property).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + + /// 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.Api20220801.IPolicyFragmentContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyFragmentContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PolicyFragmentContractProperties()); 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.Api20220801.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.Api20220801.IPolicyFragmentContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PolicyFragmentContractProperties()); 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 fragment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Value { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyFragmentContractPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPolicyFragmentContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (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 + { + /// 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; } + /// 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 + { + /// 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; } + /// Properties of the Policy Fragment. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyFragmentContractProperties Property { get; set; } + /// Contents of the policy fragment. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentContract.json.cs new file mode 100644 index 000000000000..fc7260171347 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPolicyFragmentContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyFragmentContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PolicyFragmentContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentContractProperties.cs new file mode 100644 index 000000000000..57dc885886df --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentContractProperties.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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy fragment contract properties. + public partial class PolicyFragmentContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyFragmentContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + + /// 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; } + /// 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; } + /// Contents of the policy fragment. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentContractProperties.json.cs new file mode 100644 index 000000000000..d1c22b9f0f35 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/PolicyFragmentContractProperties.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.Api20220801 +{ + 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.Api20220801.IPolicyFragmentContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPolicyFragmentContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode 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 ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigCollection.cs new file mode 100644 index 000000000000..3717ef5a9e12 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IPortalConfigContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigCollection.json.cs new file mode 100644 index 000000000000..d7192809b458 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigContract.cs new file mode 100644 index 000000000000..fa485f87eac4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The developer portal configuration contract. + public partial class PortalConfigContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).CorAllowedOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).CspAllowedSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).CspMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).CspReportUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).DelegationDelegateRegistration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).DelegationDelegateSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).DelegationUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).DelegationValidationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).EnableBasicAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigCorsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigContractInternal.Cor { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal)Property).Cor; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal)Property).Cor = value; } + + /// Internal Acessors for Csp + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigCspProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigContractInternal.Csp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal)Property).Csp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal)Property).Csp = value; } + + /// Internal Acessors for Delegation + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigDelegationProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigContractInternal.Delegation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal)Property).Delegation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal)Property).Delegation = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalConfigProperties()); set { {_property = value;} } } + + /// Internal Acessors for Signin + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignin Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigContractInternal.Signin { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal)Property).Signin; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal)Property).Signin = value; } + + /// Internal Acessors for Signup + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignup Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigContractInternal.Signup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal)Property).Signup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal)Property).Signup = value; } + + /// Internal Acessors for SignupTermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigTermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigContractInternal.SignupTermsOfService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal)Property).SignupTermsOfService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPortalConfigProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).SigninRequire; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).TermOfServiceRequireConsent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesInternal)Property).TermOfServiceText; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IPortalConfigProperties Property { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignin Signin { get; set; } + /// Redirect anonymous users to the sign-in page. + bool? SigninRequire { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignup Signup { get; set; } + /// Terms of service settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigContract.json.cs new file mode 100644 index 000000000000..9bb48e61e3cc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PortalConfigCorsProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigCorsProperties.cs new file mode 100644 index 000000000000..366444f8369f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigCorsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigCorsProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigCorsProperties.json.cs new file mode 100644 index 000000000000..2ce1e9f87b07 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigCorsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigCorsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigCspProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigCspProperties.cs new file mode 100644 index 000000000000..362f14b51490 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigCspProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigCspProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigCspProperties.json.cs new file mode 100644 index 000000000000..9eafbcee909b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigCspProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigCspProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigDelegationProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigDelegationProperties.cs new file mode 100644 index 000000000000..cd7fceec5a18 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalConfigDelegationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigDelegationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigDelegationProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigDelegationProperties.json.cs new file mode 100644 index 000000000000..7cdb06d519d8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigDelegationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigDelegationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigProperties.cs new file mode 100644 index 000000000000..7814a5bcb2b1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigCorsProperties Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigCorsPropertiesInternal)Cor).AllowedOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigCorsPropertiesInternal)Cor).AllowedOrigin = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigCspProperties Csp { get => (this._csp = this._csp ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigCspPropertiesInternal)Csp).AllowedSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigCspPropertiesInternal)Csp).Mode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigCspPropertiesInternal)Csp).ReportUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigCspPropertiesInternal)Csp).ReportUri = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigDelegationProperties Delegation { get => (this._delegation = this._delegation ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigDelegationPropertiesInternal)Delegation).DelegateRegistration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigDelegationPropertiesInternal)Delegation).DelegateSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigDelegationPropertiesInternal)Delegation).DelegationUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigDelegationPropertiesInternal)Delegation).ValidationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigCorsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal.Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalConfigCorsProperties()); set { {_cor = value;} } } + + /// Internal Acessors for Csp + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigCspProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal.Csp { get => (this._csp = this._csp ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalConfigCspProperties()); set { {_csp = value;} } } + + /// Internal Acessors for Delegation + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigDelegationProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal.Delegation { get => (this._delegation = this._delegation ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalConfigDelegationProperties()); set { {_delegation = value;} } } + + /// Internal Acessors for Signin + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignin Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal.Signin { get => (this._signin = this._signin ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalConfigPropertiesSignin()); set { {_signin = value;} } } + + /// Internal Acessors for Signup + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignup Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal.Signup { get => (this._signup = this._signup ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalConfigPropertiesSignup()); set { {_signup = value;} } } + + /// Internal Acessors for SignupTermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigTermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesInternal.SignupTermsOfService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignupInternal)Signup).TermsOfService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignupInternal)Signup).TermsOfService = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignin _signin; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignin Signin { get => (this._signin = this._signin ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesSigninInternal)Signin).Require; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSigninInternal)Signin).Require = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignup _signup; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignup Signup { get => (this._signup = this._signup ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesSignupInternal)Signup).TermOfServiceRequireConsent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigPropertiesSignupInternal)Signup).TermOfServiceText; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IPortalConfigPropertiesSignin Signin { get; set; } + /// Redirect anonymous users to the sign-in page. + bool? SigninRequire { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignup Signup { get; set; } + /// Terms of service settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigProperties.json.cs new file mode 100644 index 000000000000..9465b2cf9a38 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.PortalConfigPropertiesSignin.FromJson(__jsonSignin) : Signin;} + {_signup = If( json?.PropertyT("signup"), out var __jsonSignup) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalConfigPropertiesSignup.FromJson(__jsonSignup) : Signup;} + {_delegation = If( json?.PropertyT("delegation"), out var __jsonDelegation) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalConfigDelegationProperties.FromJson(__jsonDelegation) : Delegation;} + {_cor = If( json?.PropertyT("cors"), out var __jsonCors) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalConfigCorsProperties.FromJson(__jsonCors) : Cor;} + {_csp = If( json?.PropertyT("csp"), out var __jsonCsp) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigPropertiesSignin.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigPropertiesSignin.cs new file mode 100644 index 000000000000..631dea2ac8c6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalConfigPropertiesSignin : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignin, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigPropertiesSignin.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigPropertiesSignin.json.cs new file mode 100644 index 000000000000..a0d3e63e19a3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigPropertiesSignin. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignin. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigPropertiesSignup.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigPropertiesSignup.cs new file mode 100644 index 000000000000..744c087b0d69 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalConfigPropertiesSignup : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignup, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignupInternal + { + + /// Internal Acessors for TermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigTermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignupInternal.TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigTermsOfServicePropertiesInternal)TermsOfService).RequireConsent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigTermsOfServicePropertiesInternal)TermsOfService).Text; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigTermsOfServicePropertiesInternal)TermsOfService).Text = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigTermsOfServiceProperties TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalConfigTermsOfServiceProperties TermsOfService { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigPropertiesSignup.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigPropertiesSignup.json.cs new file mode 100644 index 000000000000..8c27c96bc0c2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigPropertiesSignup. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigPropertiesSignup. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PortalConfigTermsOfServiceProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigTermsOfServiceProperties.cs new file mode 100644 index 000000000000..5b14c19e1524 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Terms of service contract properties. + public partial class PortalConfigTermsOfServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigTermsOfServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalConfigTermsOfServiceProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalConfigTermsOfServiceProperties.json.cs new file mode 100644 index 000000000000..8c93eef18e12 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalConfigTermsOfServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalConfigTermsOfServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalDelegationSettings.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalDelegationSettings.cs new file mode 100644 index 000000000000..2328bdb6de0e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalDelegationSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalDelegationSettingsProperties()); set { {_property = value;} } } + + /// Internal Acessors for Subscription + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionsDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettingsInternal.Subscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettingsPropertiesInternal)Property).Subscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettingsPropertiesInternal)Property).Subscription = value; } + + /// Internal Acessors for UserRegistration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRegistrationDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettingsInternal.UserRegistration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettingsPropertiesInternal)Property).UserRegistration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPortalDelegationSettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalDelegationSettingsPropertiesInternal)Property).SubscriptionEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalDelegationSettingsPropertiesInternal)Property).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalDelegationSettingsPropertiesInternal)Property).UserRegistrationEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalDelegationSettingsPropertiesInternal)Property).ValidationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPortalDelegationSettingsProperties Property { get; set; } + /// Subscriptions delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PortalDelegationSettings.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalDelegationSettings.json.cs new file mode 100644 index 000000000000..86726926ef1f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalDelegationSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PortalDelegationSettingsProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalDelegationSettingsProperties.cs new file mode 100644 index 000000000000..edcbd9861081 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Delegation settings contract properties. + public partial class PortalDelegationSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettingsPropertiesInternal + { + + /// Internal Acessors for Subscription + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionsDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettingsPropertiesInternal.Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.SubscriptionsDelegationSettingsProperties()); set { {_subscription = value;} } } + + /// Internal Acessors for UserRegistration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRegistrationDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettingsPropertiesInternal.UserRegistration { get => (this._userRegistration = this._userRegistration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.RegistrationDelegationSettingsProperties()); set { {_userRegistration = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionsDelegationSettingsProperties Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionsDelegationSettingsPropertiesInternal)Subscription).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IRegistrationDelegationSettingsProperties UserRegistration { get => (this._userRegistration = this._userRegistration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRegistrationDelegationSettingsPropertiesInternal)UserRegistration).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PortalDelegationSettingsProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalDelegationSettingsProperties.json.cs new file mode 100644 index 000000000000..7c83df747b57 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalDelegationSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalDelegationSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.SubscriptionsDelegationSettingsProperties.FromJson(__jsonSubscriptions) : Subscription;} + {_userRegistration = If( json?.PropertyT("userRegistration"), out var __jsonUserRegistration) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalRevisionCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalRevisionCollection.cs new file mode 100644 index 000000000000..acbd4fff2081 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged list of portal revisions. + public partial class PortalRevisionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IPortalRevisionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalRevisionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalRevisionCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalRevisionCollection.json.cs new file mode 100644 index 000000000000..d7995167b3ac --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalRevisionCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalRevisionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalRevisionContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalRevisionContract.cs new file mode 100644 index 000000000000..61650131fc90 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalRevisionContract.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Portal Revision's contract details. + public partial class PortalRevisionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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(); + + /// 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.Api20220801.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.Api20220801.IPortalRevisionContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalRevisionContractPropertiesInternal)Property).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractPropertiesInternal)Property).IsCurrent = 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 CreatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractInternal.CreatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractPropertiesInternal)Property).CreatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractPropertiesInternal)Property).CreatedDateTime = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalRevisionContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractPropertiesInternal)Property).Status = value; } + + /// Internal Acessors for StatusDetail + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractInternal.StatusDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractPropertiesInternal)Property).StatusDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractPropertiesInternal)Property).StatusDetail = value; } + + /// Internal Acessors for UpdatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractInternal.UpdatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractPropertiesInternal)Property).UpdatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPortalRevisionContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalRevisionContractProperties()); set => this._property = value; } + + /// 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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IPortalRevisionContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (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 + { + /// 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; } + /// 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 + { + /// 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; } + /// Properties of the portal revisions. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractProperties Property { 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/generated/api/Models/Api20220801/PortalRevisionContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalRevisionContract.json.cs new file mode 100644 index 000000000000..58054e1899a5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalRevisionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PortalRevisionContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalRevisionContractProperties.cs new file mode 100644 index 000000000000..5eed62445325 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalRevisionContractProperties.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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalRevisionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalRevisionContractPropertiesInternal.CreatedDateTime { get => this._createdDateTime; set { {_createdDateTime = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractPropertiesInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for StatusDetail + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractPropertiesInternal.StatusDetail { get => this._statusDetail; set { {_statusDetail = value;} } } + + /// Internal Acessors for UpdatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractPropertiesInternal.UpdatedDateTime { get => this._updatedDateTime; set { {_updatedDateTime = value;} } } + + /// 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; } + /// 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; } + /// 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/generated/api/Models/Api20220801/PortalRevisionContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalRevisionContractProperties.json.cs new file mode 100644 index 000000000000..9257bdf23d69 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalRevisionContractProperties.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.Api20220801 +{ + 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.Api20220801.IPortalRevisionContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalRevisionContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode 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 ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSettingValidationKeyContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSettingValidationKeyContract.cs new file mode 100644 index 000000000000..31bbcd2e9121 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSettingValidationKeyContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalSettingValidationKeyContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSettingValidationKeyContract.json.cs new file mode 100644 index 000000000000..3e16ebe8a20e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSettingValidationKeyContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingValidationKeyContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalSettingsCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSettingsCollection.cs new file mode 100644 index 000000000000..e931a020fbdc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Descriptions of API Management policies. + public partial class PortalSettingsCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IPortalSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSettingsCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSettingsCollection.json.cs new file mode 100644 index 000000000000..a3f98767b789 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSettingsCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalSettingsContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSettingsContract.cs new file mode 100644 index 000000000000..861c90ed0837 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSettingsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContractPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalSettingsContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Subscription + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionsDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractInternal.Subscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractPropertiesInternal)Property).Subscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractPropertiesInternal)Property).Subscription = value; } + + /// Internal Acessors for TermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractInternal.TermsOfService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractPropertiesInternal)Property).TermsOfService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractPropertiesInternal)Property).TermsOfService = value; } + + /// Internal Acessors for UserRegistration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRegistrationDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractInternal.UserRegistration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractPropertiesInternal)Property).UserRegistration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPortalSettingsContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContractPropertiesInternal)Property).SubscriptionEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContractPropertiesInternal)Property).TermOfServiceConsentRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContractPropertiesInternal)Property).TermOfServiceEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContractPropertiesInternal)Property).TermOfServiceText; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContractPropertiesInternal)Property).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContractPropertiesInternal)Property).UserRegistrationEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContractPropertiesInternal)Property).ValidationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSettingsContractProperties Property { get; set; } + /// Subscriptions delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITermsOfServiceProperties TermsOfService { get; set; } + /// A delegation Url. + string Url { get; set; } + /// User registration delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalSettingsContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSettingsContract.json.cs new file mode 100644 index 000000000000..e7a1d82bc778 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSettingsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PortalSettingsContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSettingsContractProperties.cs new file mode 100644 index 000000000000..eda9b53a658a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-in settings contract properties. + public partial class PortalSettingsContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionsDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractPropertiesInternal.Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.SubscriptionsDelegationSettingsProperties()); set { {_subscription = value;} } } + + /// Internal Acessors for TermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractPropertiesInternal.TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.TermsOfServiceProperties()); set { {_termsOfService = value;} } } + + /// Internal Acessors for UserRegistration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRegistrationDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractPropertiesInternal.UserRegistration { get => (this._userRegistration = this._userRegistration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.RegistrationDelegationSettingsProperties()); set { {_userRegistration = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionsDelegationSettingsProperties Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionsDelegationSettingsPropertiesInternal)Subscription).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITermsOfServicePropertiesInternal)TermsOfService).ConsentRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITermsOfServicePropertiesInternal)TermsOfService).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITermsOfServicePropertiesInternal)TermsOfService).Text; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITermsOfServicePropertiesInternal)TermsOfService).Text = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITermsOfServiceProperties TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IRegistrationDelegationSettingsProperties UserRegistration { get => (this._userRegistration = this._userRegistration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRegistrationDelegationSettingsPropertiesInternal)UserRegistration).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ITermsOfServiceProperties TermsOfService { get; set; } + /// A delegation Url. + string Url { get; set; } + /// User registration delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalSettingsContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSettingsContractProperties.json.cs new file mode 100644 index 000000000000..293f3050df17 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSettingsContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSettingsContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.SubscriptionsDelegationSettingsProperties.FromJson(__jsonSubscriptions) : Subscription;} + {_userRegistration = If( json?.PropertyT("userRegistration"), out var __jsonUserRegistration) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.RegistrationDelegationSettingsProperties.FromJson(__jsonUserRegistration) : UserRegistration;} + {_termsOfService = If( json?.PropertyT("termsOfService"), out var __jsonTermsOfService) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalSigninSettingProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSigninSettingProperties.cs new file mode 100644 index 000000000000..6e6a696a840b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-in settings contract properties. + public partial class PortalSigninSettingProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSigninSettingProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalSigninSettingProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSigninSettingProperties.json.cs new file mode 100644 index 000000000000..a91dcad059ba --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSigninSettingProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSigninSettingProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PortalSigninSettings.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSigninSettings.cs new file mode 100644 index 000000000000..3a664977b247 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSigninSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSigninSettingPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSigninSettingProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSigninSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPortalSigninSettingProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPortalSigninSettingProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSigninSettings.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSigninSettings.json.cs new file mode 100644 index 000000000000..e1b53041f3e3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSigninSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSigninSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PortalSignupSettings.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSignupSettings.cs new file mode 100644 index 000000000000..cb32d8546461 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSignupSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSignupSettingsPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSignupSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSignupSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PortalSignupSettingsProperties()); set { {_property = value;} } } + + /// Internal Acessors for TermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSignupSettingsInternal.TermsOfService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSignupSettingsPropertiesInternal)Property).TermsOfService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPortalSignupSettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSignupSettingsPropertiesInternal)Property).TermOfServiceConsentRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSignupSettingsPropertiesInternal)Property).TermOfServiceEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPortalSignupSettingsPropertiesInternal)Property).TermOfServiceText; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.ITermsOfServiceProperties TermsOfService { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSignupSettings.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSignupSettings.json.cs new file mode 100644 index 000000000000..5d0cf5118496 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSignupSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSignupSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PortalSignupSettingsProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSignupSettingsProperties.cs new file mode 100644 index 000000000000..0a4292e90e85 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-up settings contract properties. + public partial class PortalSignupSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSignupSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSignupSettingsPropertiesInternal.TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITermsOfServicePropertiesInternal)TermsOfService).ConsentRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITermsOfServicePropertiesInternal)TermsOfService).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITermsOfServicePropertiesInternal)TermsOfService).Text; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITermsOfServicePropertiesInternal)TermsOfService).Text = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITermsOfServiceProperties TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITermsOfServiceProperties TermsOfService { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSignupSettingsProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PortalSignupSettingsProperties.json.cs new file mode 100644 index 000000000000..74d296e2348d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPortalSignupSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPortalSignupSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PrivateEndpointConnectionRequest.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PrivateEndpointConnectionRequest.cs new file mode 100644 index 000000000000..24b3a4e22209 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPrivateEndpointConnectionRequest, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPrivateEndpointConnectionRequestInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPrivateEndpointConnectionRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPrivateEndpointConnectionRequestProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/PrivateEndpointConnectionRequest.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PrivateEndpointConnectionRequest.json.cs new file mode 100644 index 000000000000..f8bb836d2fcd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPrivateEndpointConnectionRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PrivateEndpointConnectionRequestProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PrivateEndpointConnectionRequestProperties.cs new file mode 100644 index 000000000000..bdd5c9c8043f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPrivateEndpointConnectionRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionRequestPropertiesInternal + { + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PrivateEndpointConnectionRequestProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PrivateEndpointConnectionRequestProperties.json.cs new file mode 100644 index 000000000000..6ecdc52575d9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPrivateEndpointConnectionRequestProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionRequestProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/PrivateEndpointConnectionWrapperProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PrivateEndpointConnectionWrapperProperties.cs new file mode 100644 index 000000000000..b27774aeb089 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the PrivateEndpointConnectProperties. + public partial class PrivateEndpointConnectionWrapperProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal.GroupId { get => this._groupId; set { {_groupId = value;} } } + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IArmIdWrapper Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ArmIdWrapper()); set { {_privateEndpoint = value;} } } + + /// Internal Acessors for PrivateEndpointId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IArmIdWrapperInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IArmIdWrapperInternal)PrivateEndpoint).Id = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IArmIdWrapper PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/PrivateEndpointConnectionWrapperProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/PrivateEndpointConnectionWrapperProperties.json.cs new file mode 100644 index 000000000000..231da3d86efd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IPrivateEndpointConnectionWrapperProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ProductCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductCollection.cs new file mode 100644 index 000000000000..d4f5dbd39374 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Products list representation. + public partial class ProductCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductCollection.json.cs new file mode 100644 index 000000000000..13e3d01ec2a9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IProductCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ProductContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductContract.cs new file mode 100644 index 000000000000..73cab5316e58 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product details. + public partial class ProductContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IProductContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ProductContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductContract.json.cs new file mode 100644 index 000000000000..8ebfbac3b3e7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IProductContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ProductContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductContractProperties.cs new file mode 100644 index 000000000000..547090380506 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product profile. + public partial class ProductContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductEntityBaseParameters __productEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal + { + /// Product name. + string DisplayName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductContractProperties.json.cs new file mode 100644 index 000000000000..8206f54e2b05 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IProductContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ProductEntityBaseParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductEntityBaseParameters.cs new file mode 100644 index 000000000000..9ccb67cafe43 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product Entity Base Parameters + public partial class ProductEntityBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductEntityBaseParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ProductEntityBaseParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductEntityBaseParameters.json.cs new file mode 100644 index 000000000000..b125dbd8e5ad --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IProductEntityBaseParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductEntityBaseParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ProductTagResourceContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductTagResourceContractProperties.cs new file mode 100644 index 000000000000..da1d1fbd80f3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product profile. + public partial class ProductTagResourceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductTagResourceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductTagResourceContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductEntityBaseParameters __productEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ProductTagResourceContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductTagResourceContractProperties.json.cs new file mode 100644 index 000000000000..1104628e0465 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IProductTagResourceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductTagResourceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ProductUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductUpdateParameters.cs new file mode 100644 index 000000000000..1cc5ab5650a5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product Update parameters. + public partial class ProductUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductUpdatePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductUpdatePropertiesInternal)Property).DisplayName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ProductUpdateProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ProductUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductUpdateParameters.json.cs new file mode 100644 index 000000000000..bba1662bcfde --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IProductUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ProductUpdateProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductUpdateProperties.cs new file mode 100644 index 000000000000..77921f4a14fd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IProductUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductUpdatePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductEntityBaseParameters __productEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal + { + /// Product name. + string DisplayName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductUpdateProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ProductUpdateProperties.json.cs new file mode 100644 index 000000000000..2dd8ce2a0797 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IProductUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/QuotaCounterCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterCollection.cs new file mode 100644 index 000000000000..709a3bb94ab2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Quota Counter list representation. + public partial class QuotaCounterCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IQuotaCounterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterCollection.json.cs new file mode 100644 index 000000000000..2524984abce0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IQuotaCounterCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/QuotaCounterContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterContract.cs new file mode 100644 index 000000000000..8362c0a1ccd4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter details. + public partial class QuotaCounterContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterValueContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterContractInternal.Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IQuotaCounterValueContractProperties Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterValueContractPropertiesInternal)Value).CallsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterValueContractPropertiesInternal)Value).KbTransferred; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/QuotaCounterContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterContract.json.cs new file mode 100644 index 000000000000..c0185839c5fd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IQuotaCounterContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/QuotaCounterValueContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterValueContract.cs new file mode 100644 index 000000000000..8f34ce1ff7b0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter value details. + public partial class QuotaCounterValueContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueContractInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueContractInternal.Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.QuotaCounterValueContractProperties()); set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterValueContractProperties Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterValueContractPropertiesInternal)Value).CallsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterValueContractPropertiesInternal)Value).KbTransferred; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/QuotaCounterValueContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterValueContract.json.cs new file mode 100644 index 000000000000..ff08869a4a05 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IQuotaCounterValueContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/QuotaCounterValueContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterValueContractProperties.cs new file mode 100644 index 000000000000..0d2f655e709a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter value details. + public partial class QuotaCounterValueContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/QuotaCounterValueContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterValueContractProperties.json.cs new file mode 100644 index 000000000000..2eb590ad2784 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IQuotaCounterValueContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/QuotaCounterValueUpdateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterValueUpdateContract.cs new file mode 100644 index 000000000000..12c97a6e2da9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter value details. + public partial class QuotaCounterValueUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterValueContractPropertiesInternal)Property).CallsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterValueContractPropertiesInternal)Property).KbTransferred; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueContractPropertiesInternal)Property).KbTransferred = value ?? default(double); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.QuotaCounterValueContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterValueContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IQuotaCounterValueContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterValueUpdateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/QuotaCounterValueUpdateContract.json.cs new file mode 100644 index 000000000000..0ec52089e115 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IQuotaCounterValueUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IQuotaCounterValueUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/RecipientEmailCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientEmailCollection.cs new file mode 100644 index 000000000000..9d126943cf46 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Recipient User list representation. + public partial class RecipientEmailCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientEmailCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientEmailContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientEmailContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientEmailContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientEmailCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientEmailCollection.json.cs new file mode 100644 index 000000000000..393707f40217 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRecipientEmailCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientEmailCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientEmailContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RecipientEmailContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientEmailContract.cs new file mode 100644 index 000000000000..d13dd7031245 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient Email details. + public partial class RecipientEmailContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientEmailContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientEmailContractPropertiesInternal)Property).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientEmailContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientEmailContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IRecipientEmailContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientEmailContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientEmailContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientEmailContract.json.cs new file mode 100644 index 000000000000..b00d46619baf --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRecipientEmailContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientEmailContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/RecipientEmailContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientEmailContractProperties.cs new file mode 100644 index 000000000000..583ac42cf881 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient Email Contract Properties. + public partial class RecipientEmailContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientEmailContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RecipientEmailContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientEmailContractProperties.json.cs new file mode 100644 index 000000000000..2dc752f2abb1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRecipientEmailContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientEmailContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RecipientUserCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientUserCollection.cs new file mode 100644 index 000000000000..02f40d284e60 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Recipient User list representation. + public partial class RecipientUserCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientUserCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientUserContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientUserContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientUserContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientUserCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientUserCollection.json.cs new file mode 100644 index 000000000000..a63364491209 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRecipientUserCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientUserCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientUserContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RecipientUserContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientUserContract.cs new file mode 100644 index 000000000000..77fc1456fa24 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient User details. + public partial class RecipientUserContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientUserContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientUsersContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientUserContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IRecipientUsersContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRecipientUsersContractPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/RecipientUserContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientUserContract.json.cs new file mode 100644 index 000000000000..a750fd0c5948 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRecipientUserContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientUserContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/RecipientUsersContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientUsersContractProperties.cs new file mode 100644 index 000000000000..b39ce55fc5c6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient User Contract Properties. + public partial class RecipientUsersContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientUsersContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RecipientUsersContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientUsersContractProperties.json.cs new file mode 100644 index 000000000000..3350dea63a16 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRecipientUsersContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientUsersContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RecipientsContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientsContractProperties.cs new file mode 100644 index 000000000000..cba1dd64317b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Notification Parameter contract. + public partial class RecipientsContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientsContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RecipientsContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RecipientsContractProperties.json.cs new file mode 100644 index 000000000000..83a1c26f480c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRecipientsContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRecipientsContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RegionContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RegionContract.cs new file mode 100644 index 000000000000..c1534bae0d1d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Region profile. + public partial class RegionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRegionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/RegionContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RegionContract.json.cs new file mode 100644 index 000000000000..243f0c16c1e7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRegionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRegionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RegionListResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RegionListResult.cs new file mode 100644 index 000000000000..7330a1117364 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Lists Regions operation response details. + public partial class RegionListResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRegionListResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IRegionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRegionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/RegionListResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RegionListResult.json.cs new file mode 100644 index 000000000000..a39ee2d67c69 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRegionListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRegionListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRegionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RegistrationDelegationSettingsProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RegistrationDelegationSettingsProperties.cs new file mode 100644 index 000000000000..4f8deca9d96d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User registration delegation settings properties. + public partial class RegistrationDelegationSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRegistrationDelegationSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RegistrationDelegationSettingsProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RegistrationDelegationSettingsProperties.json.cs new file mode 100644 index 000000000000..7c4c030226b9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRegistrationDelegationSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRegistrationDelegationSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RemotePrivateEndpointConnectionWrapper.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RemotePrivateEndpointConnectionWrapper.cs new file mode 100644 index 000000000000..474f83c9eb5b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Remote Private Endpoint Connection resource. + public partial class RemotePrivateEndpointConnectionWrapper : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRemotePrivateEndpointConnectionWrapper, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IRemotePrivateEndpointConnectionWrapperInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).GroupId = value; } + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IArmIdWrapper Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRemotePrivateEndpointConnectionWrapperInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateEndpoint = value; } + + /// Internal Acessors for PrivateEndpointId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRemotePrivateEndpointConnectionWrapperInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateEndpointId = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRemotePrivateEndpointConnectionWrapperInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRemotePrivateEndpointConnectionWrapperInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.PrivateEndpointConnectionWrapperProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRemotePrivateEndpointConnectionWrapperInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperProperties _property; + + /// Resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IPrivateEndpointConnectionWrapperProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/RemotePrivateEndpointConnectionWrapper.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RemotePrivateEndpointConnectionWrapper.json.cs new file mode 100644 index 000000000000..7a34dfba443b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRemotePrivateEndpointConnectionWrapper. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRemotePrivateEndpointConnectionWrapper. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ReportCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ReportCollection.cs new file mode 100644 index 000000000000..1ccf0b9bbfd5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Report records list representation. + public partial class ReportCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IReportCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IReportRecordContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IReportRecordContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IReportRecordContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ReportCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ReportCollection.json.cs new file mode 100644 index 000000000000..6bfce44e49fd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IReportCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IReportCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IReportRecordContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ReportRecordContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ReportRecordContract.cs new file mode 100644 index 000000000000..e67d71e3878e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Report data. + public partial class ReportRecordContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IReportRecordContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IReportRecordContractInternal.ProductId { get => this._productId; set { {_productId = value;} } } + + /// Internal Acessors for UserId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ReportRecordContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ReportRecordContract.json.cs new file mode 100644 index 000000000000..1678d0b54c01 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IReportRecordContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IReportRecordContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RepresentationContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RepresentationContract.cs new file mode 100644 index 000000000000..65e58d1cce01 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation request/response representation details. + public partial class RepresentationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRepresentationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IParameterExamplesContract Example { get => (this._example = this._example ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ParameterExamplesContract()); set => this._example = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IParameterExamplesContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/RepresentationContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RepresentationContract.json.cs new file mode 100644 index 000000000000..d9026dfc545d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRepresentationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRepresentationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ParameterContract.FromJson(__u) )) ))() : null : FormParameter;} + {_example = If( json?.PropertyT("examples"), out var __jsonExamples) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RequestContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RequestContract.cs new file mode 100644 index 000000000000..9f5be072eb77 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation request details. + public partial class RequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IParameterContract[] Header { get => this._header; set => this._header = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] QueryParameter { get => this._queryParameter; set => this._queryParameter = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] Header { get; set; } + /// Collection of operation request query parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IParameterContract[] QueryParameter { get; set; } + /// Collection of operation request representations. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRepresentationContract[] Representation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/RequestContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RequestContract.json.cs new file mode 100644 index 000000000000..2b8ce2075d12 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRequestContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RequestReportCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RequestReportCollection.cs new file mode 100644 index 000000000000..71fcce90aff3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Report records list representation. + public partial class RequestReportCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestReportCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRequestReportRecordContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRequestReportRecordContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRequestReportRecordContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/RequestReportCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RequestReportCollection.json.cs new file mode 100644 index 000000000000..59f4bddc2df0 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRequestReportCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestReportCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRequestReportRecordContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RequestReportRecordContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RequestReportRecordContract.cs new file mode 100644 index 000000000000..84517600e730 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Request Report data. + public partial class RequestReportRecordContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestReportRecordContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRequestReportRecordContractInternal.ProductId { get => this._productId; set { {_productId = value;} } } + + /// Internal Acessors for UserId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/RequestReportRecordContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/RequestReportRecordContract.json.cs new file mode 100644 index 000000000000..64f2d3e72b99 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IRequestReportRecordContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRequestReportRecordContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResolverCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverCollection.cs new file mode 100644 index 000000000000..3e69ab6617fa --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Resolver list representation. + public partial class ResolverCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverCollection.json.cs new file mode 100644 index 000000000000..24ec31d212f6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResolverCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResolverContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverContract.cs new file mode 100644 index 000000000000..10b30bba415d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// GraphQL API Resolver details. + public partial class ResolverContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverEntityBaseContractInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverEntityBaseContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverEntityBaseContractInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverEntityBaseContractInternal)Property).Path = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverEntityBaseContract Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IResolverEntityBaseContract Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverContract.json.cs new file mode 100644 index 000000000000..2d38fec3272d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResolverContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ResolverEntityBaseContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverEntityBaseContract.cs new file mode 100644 index 000000000000..72807d571cfd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResolverEntityBaseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResolverEntityBaseContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverEntityBaseContract.json.cs new file mode 100644 index 000000000000..bada9af80664 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResolverEntityBaseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverEntityBaseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResolverResultContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverResultContract.cs new file mode 100644 index 000000000000..e4f240e76f3f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Long Running Git Resolver Results. + public partial class ResolverResultContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultLogItemContract[] ActionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultContractPropertiesInternal)Property).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorFieldContract[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractPropertiesInternal)Property).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultContractPropertiesInternal)Property).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultLogItemContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractInternal.ActionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractPropertiesInternal)Property).ActionLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractPropertiesInternal)Property).ActionLog = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractPropertiesInternal)Property).Error = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractPropertiesInternal)Property).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultContractPropertiesInternal)Property).ResultInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultContractPropertiesInternal)Property).Started; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultContractPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultContractPropertiesInternal)Property).Updated; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultLogItemContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IErrorFieldContract[] Detail { get; set; } + /// Error Body Contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ResolverResultContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverResultContract.json.cs new file mode 100644 index 000000000000..d4593871036a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResolverResultContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ResolverResultContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverResultContractProperties.cs new file mode 100644 index 000000000000..369adffadd18 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resolver Result. + public partial class ResolverResultContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IErrorResponseBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorFieldContract[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorResponseBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorResponseBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for ActionLog + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultLogItemContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractPropertiesInternal.ActionLog { get => this._actionLog; set { {_actionLog = value;} } } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractPropertiesInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverResultLogItemContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IErrorFieldContract[] Detail { get; set; } + /// Error Body Contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResolverResultContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverResultContractProperties.json.cs new file mode 100644 index 000000000000..611650f7fa1e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResolverResultContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IResolverResultLogItemContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResolverResultLogItemContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverResultLogItemContract.cs new file mode 100644 index 000000000000..1f17b19a1e63 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResolverResultLogItemContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResolverResultLogItemContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverResultLogItemContract.json.cs new file mode 100644 index 000000000000..5bcc00d35aab --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResolverResultLogItemContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverResultLogItemContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResolverUpdateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverUpdateContract.cs new file mode 100644 index 000000000000..0707c61494b3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResolverUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverUpdateContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverUpdateContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverUpdateContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverUpdateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverUpdateContractPropertiesInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverUpdateContractPropertiesInternal)Property).Path = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverUpdateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResolverUpdateContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverUpdateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverUpdateContract.json.cs new file mode 100644 index 000000000000..3d2a1df85511 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResolverUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ResolverUpdateContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverUpdateContractProperties.cs new file mode 100644 index 000000000000..9b844387a62c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resolver Update Contract Properties. + public partial class ResolverUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverUpdateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResolverUpdateContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResolverUpdateContractProperties.json.cs new file mode 100644 index 000000000000..bbd0e7429e3d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResolverUpdateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResolverUpdateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResourceCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceCollection.cs new file mode 100644 index 000000000000..28dca9f59383 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A collection of resources. + public partial class ResourceCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResourceCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceCollection.json.cs new file mode 100644 index 000000000000..a4396e6c1dbe --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResourceCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResourceCollectionValueItem.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceCollectionValueItem.cs new file mode 100644 index 000000000000..32ccb8c43ff7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ResourceCollectionValueItem : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceCollectionValueItem, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResourceCollectionValueItem.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceCollectionValueItem.json.cs new file mode 100644 index 000000000000..bbfa3fc704b8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResourceCollectionValueItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceCollectionValueItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResourceLocationDataContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceLocationDataContract.cs new file mode 100644 index 000000000000..c001ec2e379d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resource location data properties. + public partial class ResourceLocationDataContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceLocationDataContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResourceLocationDataContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceLocationDataContract.json.cs new file mode 100644 index 000000000000..9825f4aedbdc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResourceLocationDataContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceLocationDataContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResourceSku.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceSku.cs new file mode 100644 index 000000000000..c53db999da8c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResourceSku, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResourceSku.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceSku.json.cs new file mode 100644 index 000000000000..b06010107876 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResourceSku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResourceSkuCapacity.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceSkuCapacity.cs new file mode 100644 index 000000000000..48b7bf6d1124 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResourceSkuCapacity, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResourceSkuCapacityInternal.Default { get => this._default; set { {_default = value;} } } + + /// Internal Acessors for Maximum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuCapacityInternal.Maximum { get => this._maximum; set { {_maximum = value;} } } + + /// Internal Acessors for Minimum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ResourceSkuCapacity.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceSkuCapacity.json.cs new file mode 100644 index 000000000000..ebf86c8119ce --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResourceSkuCapacity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuCapacity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResourceSkuResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceSkuResult.cs new file mode 100644 index 000000000000..b89d407647ff --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResourceSkuResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResourceSkuCapacity Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IResourceSkuCapacityInternal)Capacity).ScaleType; } + + /// Internal Acessors for Capacity + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuCapacity Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuResultInternal.Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ResourceSkuCapacity()); set { {_capacity = value;} } } + + /// Internal Acessors for CapacityDefault + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuResultInternal.CapacityDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuCapacityInternal)Capacity).Default; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuCapacityInternal)Capacity).Default = value; } + + /// Internal Acessors for CapacityMaximum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuResultInternal.CapacityMaximum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuCapacityInternal)Capacity).Maximum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuCapacityInternal)Capacity).Maximum = value; } + + /// Internal Acessors for CapacityMinimum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuResultInternal.CapacityMinimum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuCapacityInternal)Capacity).Minimum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuCapacityInternal)Capacity).Minimum = value; } + + /// Internal Acessors for CapacityScaleType + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuResultInternal.CapacityScaleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuCapacityInternal)Capacity).ScaleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuCapacityInternal)Capacity).ScaleType = value; } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuResultInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSku Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuResultInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IResourceSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResourceSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/ResourceSkuResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceSkuResult.json.cs new file mode 100644 index 000000000000..1f1e5ba76112 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResourceSkuResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ResourceSku.FromJson(__jsonSku) : Sku;} + {_capacity = If( json?.PropertyT("capacity"), out var __jsonCapacity) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResourceSkuResults.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceSkuResults.cs new file mode 100644 index 000000000000..f95ee8ce5fbb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResourceSkuResults, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IResourceSkuResult) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResourceSkuResult[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceSkuResults.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResourceSkuResults.json.cs new file mode 100644 index 000000000000..af934f7d5e94 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResourceSkuResults. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResourceSkuResults. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IResourceSkuResult) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/ResponseContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResponseContract.cs new file mode 100644 index 000000000000..d74183e0add4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation response details. + public partial class ResponseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResponseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IParameterContract[] Header { get => this._header; set => this._header = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract[] Header { get; set; } + /// Collection of operation response representations. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IRepresentationContract[] Representation { get; set; } + /// Operation response HTTP status code. + int StatusCode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/ResponseContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/ResponseContract.json.cs new file mode 100644 index 000000000000..f47e52e153fe --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IResponseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IResponseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IRepresentationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SamplingSettings.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SamplingSettings.cs new file mode 100644 index 000000000000..6bb7c7350827 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sampling settings for Diagnostic. + public partial class SamplingSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISamplingSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SamplingSettings.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SamplingSettings.json.cs new file mode 100644 index 000000000000..328a36d60deb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISamplingSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISamplingSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SaveConfigurationParameter.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SaveConfigurationParameter.cs new file mode 100644 index 000000000000..5bc7e4043246 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Save Tenant Configuration Contract details. + public partial class SaveConfigurationParameter : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISaveConfigurationParameter, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISaveConfigurationParameterPropertiesInternal)Property).Branch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISaveConfigurationParameterPropertiesInternal)Property).Force; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISaveConfigurationParameterPropertiesInternal)Property).Force = value ?? default(bool); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISaveConfigurationParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISaveConfigurationParameterInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.SaveConfigurationParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISaveConfigurationParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISaveConfigurationParameterProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/SaveConfigurationParameter.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SaveConfigurationParameter.json.cs new file mode 100644 index 000000000000..c4db5286e355 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISaveConfigurationParameter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISaveConfigurationParameter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/SaveConfigurationParameterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SaveConfigurationParameterProperties.cs new file mode 100644 index 000000000000..775e70122e5c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISaveConfigurationParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SaveConfigurationParameterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SaveConfigurationParameterProperties.json.cs new file mode 100644 index 000000000000..7e72d7275a40 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISaveConfigurationParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISaveConfigurationParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SchemaCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaCollection.cs new file mode 100644 index 000000000000..d9064e0c93b3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISchemaCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISchemaCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.ISchemaContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISchemaContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaCollection.json.cs new file mode 100644 index 000000000000..c4c7d5108bc2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISchemaCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISchemaContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SchemaContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaContract.cs new file mode 100644 index 000000000000..999b25c45315 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaContract.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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Schema Contract details. + public partial class SchemaContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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(); + + /// + /// 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`. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContractPropertiesInternal)Property).ContentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISchemaContractPropertiesInternal)Property).DocumentComponent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISchemaContractPropertiesInternal)Property).DocumentDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISchemaContractPropertiesInternal)Property).DocumentValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + + /// 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.Api20220801.ISchemaDocumentProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContractInternal.Document { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContractPropertiesInternal)Property).Document; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContractPropertiesInternal)Property).Document = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.SchemaContractProperties()); 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.Api20220801.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.Api20220801.ISchemaContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.SchemaContractProperties()); 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.Api20220801.ISchemaContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (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 + { + /// + /// 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`. + ///
+ [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`.", + 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; } + + } + /// API Schema Contract details. + internal partial interface ISchemaContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// 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`. + ///
+ string ContentType { get; set; } + /// Create or update Properties of the API Schema Document. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + /// Properties of the API Schema. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaContract.json.cs new file mode 100644 index 000000000000..e4888e8ea18a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISchemaContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/SchemaContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaContractProperties.cs new file mode 100644 index 000000000000..dd146e1c0492 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaContractProperties.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.Api20220801 +{ + 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.Api20220801.ISchemaContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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`. + ///
+ [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.Api20220801.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.Api20220801.ISchemaDocumentProperties Document { get => (this._document = this._document ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISchemaDocumentPropertiesInternal)Document).Component; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISchemaDocumentPropertiesInternal)Document).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISchemaDocumentPropertiesInternal)Document).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaDocumentPropertiesInternal)Document).Value = value ?? null; } + + /// Internal Acessors for Document + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaDocumentProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContractPropertiesInternal.Document { get => (this._document = this._document ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.SchemaDocumentProperties()); set { {_document = value;} } } + + /// 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`. + ///
+ [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`.", + 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; } + + } + /// 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`. + ///
+ string ContentType { get; set; } + /// Create or update Properties of the API Schema Document. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaContractProperties.json.cs new file mode 100644 index 000000000000..9b148ef2a6c5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaContractProperties.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.Api20220801 +{ + 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.Api20220801.ISchemaContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.SchemaDocumentProperties.FromJson(__jsonDocument) : Document;} + {_contentType = If( json?.PropertyT("contentType"), out var __jsonContentType) ? (string)__jsonContentType : (string)ContentType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode 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 ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaDocumentProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaDocumentProperties.cs new file mode 100644 index 000000000000..adf7ac3b4151 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Api Schema Document Properties. + public partial class SchemaDocumentProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaDocumentProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SchemaDocumentProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SchemaDocumentProperties.json.cs new file mode 100644 index 000000000000..6e5d0dd22236 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISchemaDocumentProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISchemaDocumentProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SubscriptionCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionCollection.cs new file mode 100644 index 000000000000..4a12306bd360 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Subscriptions list representation. + public partial class SubscriptionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionCollection.json.cs new file mode 100644 index 000000000000..37b1617c9a71 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SubscriptionContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionContract.cs new file mode 100644 index 000000000000..7860bea4ec41 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription details. + public partial class SubscriptionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).AllowTracing; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).EndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).ExpirationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractInternal.CreatedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionContractPropertiesInternal)Property).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionContractPropertiesInternal)Property).CreatedDate = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).NotificationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).OwnerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).PrimaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionContractPropertiesInternal)Property).PrimaryKey = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).SecondaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).StartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionContractPropertiesInternal)Property).StateComment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/SubscriptionContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionContract.json.cs new file mode 100644 index 000000000000..f307e72c31ac --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/SubscriptionContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionContractProperties.cs new file mode 100644 index 000000000000..43a149c581fc --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription details. + public partial class SubscriptionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/SubscriptionContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionContractProperties.json.cs new file mode 100644 index 000000000000..dc96e0a5a457 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SubscriptionCreateParameterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionCreateParameterProperties.cs new file mode 100644 index 000000000000..f1bf39a88480 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionCreateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SubscriptionCreateParameterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionCreateParameterProperties.json.cs new file mode 100644 index 000000000000..6ef25f803fcf --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionCreateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionCreateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SubscriptionCreateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionCreateParameters.cs new file mode 100644 index 000000000000..3bf6ddf737cf --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription create details. + public partial class SubscriptionCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionCreateParameterPropertiesInternal)Property).AllowTracing; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionCreateParameterPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionCreateParameterPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionCreateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionCreateParameterPropertiesInternal)Property).OwnerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionCreateParameterPropertiesInternal)Property).PrimaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionCreateParameterPropertiesInternal)Property).PrimaryKey = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionCreateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionCreateParameterPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionCreateParameterPropertiesInternal)Property).SecondaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionCreateParameterPropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/SubscriptionCreateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionCreateParameters.json.cs new file mode 100644 index 000000000000..db5ad89d874b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/SubscriptionKeyParameterNamesContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionKeyParameterNamesContract.cs new file mode 100644 index 000000000000..ea18fb0aa1d2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription key parameter names details. + public partial class SubscriptionKeyParameterNamesContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionKeyParameterNamesContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SubscriptionKeyParameterNamesContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionKeyParameterNamesContract.json.cs new file mode 100644 index 000000000000..3019bb2645f7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionKeyParameterNamesContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionKeyParameterNamesContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SubscriptionKeysContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionKeysContract.cs new file mode 100644 index 000000000000..62312d0ec362 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription keys. + public partial class SubscriptionKeysContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionKeysContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/SubscriptionKeysContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionKeysContract.json.cs new file mode 100644 index 000000000000..18dfd76d2269 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionKeysContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionKeysContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SubscriptionUpdateParameterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionUpdateParameterProperties.cs new file mode 100644 index 000000000000..3f1431e93bcb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SubscriptionUpdateParameterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..599100bbf2b8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SubscriptionUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionUpdateParameters.cs new file mode 100644 index 000000000000..4b48ed6c616b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription update details. + public partial class SubscriptionUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionUpdateParameterPropertiesInternal)Property).AllowTracing; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionUpdateParameterPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionUpdateParameterPropertiesInternal)Property).ExpirationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionUpdateParameterPropertiesInternal)Property).ExpirationDate = value ?? default(global::System.DateTime); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionUpdateParameterPropertiesInternal)Property).OwnerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionUpdateParameterPropertiesInternal)Property).PrimaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionUpdateParameterPropertiesInternal)Property).PrimaryKey = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionUpdateParameterPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionUpdateParameterPropertiesInternal)Property).SecondaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionUpdateParameterPropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ISubscriptionUpdateParameterPropertiesInternal)Property).StateComment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/SubscriptionUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionUpdateParameters.json.cs new file mode 100644 index 000000000000..e008b4caff03 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/SubscriptionsDelegationSettingsProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionsDelegationSettingsProperties.cs new file mode 100644 index 000000000000..afd8781aafa9 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscriptions delegation settings properties. + public partial class SubscriptionsDelegationSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionsDelegationSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/SubscriptionsDelegationSettingsProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/SubscriptionsDelegationSettingsProperties.json.cs new file mode 100644 index 000000000000..a9af16ee06ab --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ISubscriptionsDelegationSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ISubscriptionsDelegationSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TagCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagCollection.cs new file mode 100644 index 000000000000..3328856d0d00 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag list representation. + public partial class TagCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/TagCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagCollection.json.cs new file mode 100644 index 000000000000..2c7b9fae1d3c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TagContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagContract.cs new file mode 100644 index 000000000000..e2317fe17131 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag Contract details. + public partial class TagContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ITagContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ITagContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/TagContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagContract.json.cs new file mode 100644 index 000000000000..58e1688c3d56 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TagContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagContractProperties.cs new file mode 100644 index 000000000000..94f97c4d7719 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag contract Properties. + public partial class TagContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TagContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagContractProperties.json.cs new file mode 100644 index 000000000000..19b08ca16b6b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TagCreateUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagCreateUpdateParameters.cs new file mode 100644 index 000000000000..2a8b4527a167 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagCreateUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagCreateUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.TagContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/TagCreateUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagCreateUpdateParameters.json.cs new file mode 100644 index 000000000000..06c56340bf59 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagCreateUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagCreateUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TagDescriptionBaseProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionBaseProperties.cs new file mode 100644 index 000000000000..fcc5543a26e6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagDescriptionBaseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TagDescriptionBaseProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionBaseProperties.json.cs new file mode 100644 index 000000000000..eb70e7a44f81 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagDescriptionBaseProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionBaseProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TagDescriptionCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionCollection.cs new file mode 100644 index 000000000000..0af065a531a7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged TagDescription list representation. + public partial class TagDescriptionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionCollection.json.cs new file mode 100644 index 000000000000..eeb74b6fbe1e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagDescriptionCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TagDescriptionContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionContract.cs new file mode 100644 index 000000000000..96b4a6a24f1b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Contract details. + public partial class TagDescriptionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionBasePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ITagDescriptionContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionContractPropertiesInternal)Property).TagId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TagDescriptionContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionContract.json.cs new file mode 100644 index 000000000000..55199aeb5a4f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagDescriptionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TagDescriptionContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionContractProperties.cs new file mode 100644 index 000000000000..be5ee1a57d59 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// TagDescription contract Properties. + public partial class TagDescriptionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionBaseProperties __tagDescriptionBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionBasePropertiesInternal)__tagDescriptionBaseProperties).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionBasePropertiesInternal)__tagDescriptionBaseProperties).ExternalDocsDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionBasePropertiesInternal)__tagDescriptionBaseProperties).ExternalDocsUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TagDescriptionContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionContractProperties.json.cs new file mode 100644 index 000000000000..ba0537cc3153 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagDescriptionContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TagDescriptionCreateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionCreateParameters.cs new file mode 100644 index 000000000000..8879ac4b4c42 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagDescriptionCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionBasePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsUrl = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionBaseProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.TagDescriptionBaseProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionBaseProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagDescriptionBaseProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionCreateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagDescriptionCreateParameters.json.cs new file mode 100644 index 000000000000..73c2f80a420f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagDescriptionCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagDescriptionCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TagResourceCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagResourceCollection.cs new file mode 100644 index 000000000000..058c190888a1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag list representation. + public partial class TagResourceCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagResourceContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagResourceContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagResourceContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/TagResourceCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagResourceCollection.json.cs new file mode 100644 index 000000000000..cf51242e7bfd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagResourceCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagResourceContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TagResourceContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagResourceContract.cs new file mode 100644 index 000000000000..1fe363f03a7e --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// TagResource contract properties. + public partial class TagResourceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiTagResourceContractProperties Api { get => (this._api = this._api ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ApiTagResourceContractProperties()); set => this._api = value; } + + /// Internal Acessors for Operation + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractInternal.Operation { get => (this._operation = this._operation ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.OperationTagResourceContractProperties()); set { {_operation = value;} } } + + /// Internal Acessors for OperationApiName + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractInternal.OperationApiName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).ApiName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).ApiName = value; } + + /// Internal Acessors for OperationApiRevision + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractInternal.OperationApiRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).ApiRevision = value; } + + /// Internal Acessors for OperationApiVersion + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractInternal.OperationApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).ApiVersion = value; } + + /// Internal Acessors for OperationDescription + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractInternal.OperationDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).Description = value; } + + /// Internal Acessors for OperationMethod + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractInternal.OperationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).Method = value; } + + /// Internal Acessors for OperationName + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractInternal.OperationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).Name = value; } + + /// Internal Acessors for OperationUrlTemplate + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractInternal.OperationUrlTemplate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).UrlTemplate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).UrlTemplate = value; } + + /// Internal Acessors for Product + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductTagResourceContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractInternal.Product { get => (this._product = this._product ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ProductTagResourceContractProperties()); set { {_product = value;} } } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.TagResourceContractProperties()); set { {_tag = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IOperationTagResourceContractProperties Operation { get => (this._operation = this._operation ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IOperationTagResourceContractPropertiesInternal)Operation).UrlTemplate; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductTagResourceContractProperties Product { get => (this._product = this._product ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Product).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Product).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductTagResourceContractPropertiesInternal)Product).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductTagResourceContractPropertiesInternal)Product).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Product).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Product).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Product).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IProductEntityBaseParametersInternal)Product).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IProductEntityBaseParametersInternal)Product).Term = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagResourceContractProperties Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagResourceContractPropertiesInternal)Tag).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITagResourceContractPropertiesInternal)Tag).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiTagResourceContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IApiTagResourceContractProperties Api { get; set; } + /// Operation associated with the tag. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TagResourceContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagResourceContract.json.cs new file mode 100644 index 000000000000..a4d8e8898831 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagResourceContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.TagResourceContractProperties.FromJson(__jsonTag) : Tag;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.OperationTagResourceContractProperties.FromJson(__jsonOperation) : Operation;} + {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ProductTagResourceContractProperties.FromJson(__jsonProduct) : Product;} + {_api = If( json?.PropertyT("api"), out var __jsonApi) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TagResourceContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagResourceContractProperties.cs new file mode 100644 index 000000000000..13db7c1a1120 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagResourceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TagResourceContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TagResourceContractProperties.json.cs new file mode 100644 index 000000000000..51af27eb0beb --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITagResourceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITagResourceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TenantConfigurationSyncStateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantConfigurationSyncStateContract.cs new file mode 100644 index 000000000000..512522d1a110 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITenantConfigurationSyncStateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantConfigurationSyncStateContractPropertiesInternal)Property).Branch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantConfigurationSyncStateContractPropertiesInternal)Property).CommitId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantConfigurationSyncStateContractPropertiesInternal)Property).ConfigurationChangeDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantConfigurationSyncStateContractPropertiesInternal)Property).IsExport; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantConfigurationSyncStateContractPropertiesInternal)Property).IsGitEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantConfigurationSyncStateContractPropertiesInternal)Property).IsSynced; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantConfigurationSyncStateContractPropertiesInternal)Property).LastOperationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantConfigurationSyncStateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantConfigurationSyncStateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ITenantConfigurationSyncStateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantConfigurationSyncStateContractPropertiesInternal)Property).SyncDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TenantConfigurationSyncStateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantConfigurationSyncStateContract.json.cs new file mode 100644 index 000000000000..addde784380d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITenantConfigurationSyncStateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantConfigurationSyncStateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TenantConfigurationSyncStateContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantConfigurationSyncStateContractProperties.cs new file mode 100644 index 000000000000..3bc6ede978af --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant Configuration Synchronization State. + public partial class TenantConfigurationSyncStateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantConfigurationSyncStateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TenantConfigurationSyncStateContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantConfigurationSyncStateContractProperties.json.cs new file mode 100644 index 000000000000..7381dd12d725 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITenantConfigurationSyncStateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantConfigurationSyncStateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TenantSettingsCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsCollection.cs new file mode 100644 index 000000000000..80d2cbf4adca --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged AccessInformation list representation. + public partial class TenantSettingsCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantSettingsContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantSettingsContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsCollection.json.cs new file mode 100644 index 000000000000..1604d4de713c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITenantSettingsCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantSettingsContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TenantSettingsContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsContract.cs new file mode 100644 index 000000000000..cd928fc78cb3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant Settings. + public partial class TenantSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantSettingsContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ITenantSettingsContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantSettingsContractPropertiesSettings Setting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContractPropertiesInternal)Property).Setting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.ITenantSettingsContractPropertiesSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantSettingsContractProperties Property { get; set; } + /// Tenant settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContractPropertiesSettings Setting { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsContract.json.cs new file mode 100644 index 000000000000..d9d42385647d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITenantSettingsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TenantSettingsContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsContractProperties.cs new file mode 100644 index 000000000000..e9af2d1c6c30 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITenantSettingsContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContractPropertiesSettings _setting; + + /// Tenant settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContractPropertiesSettings Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantSettingsContractPropertiesSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.ITenantSettingsContractPropertiesSettings Setting { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsContractProperties.json.cs new file mode 100644 index 000000000000..1dbe98639e7c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITenantSettingsContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/TenantSettingsContractPropertiesSettings.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsContractPropertiesSettings.cs new file mode 100644 index 000000000000..22a6f2a1539c --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant settings + public partial class TenantSettingsContractPropertiesSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContractPropertiesSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TenantSettingsContractPropertiesSettings.dictionary.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsContractPropertiesSettings.dictionary.cs new file mode 100644 index 000000000000..d96084148a65 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.TenantSettingsContractPropertiesSettings source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsContractPropertiesSettings.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TenantSettingsContractPropertiesSettings.json.cs new file mode 100644 index 000000000000..579c0470ab3a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITenantSettingsContractPropertiesSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITenantSettingsContractPropertiesSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TermsOfServiceProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TermsOfServiceProperties.cs new file mode 100644 index 000000000000..5ebd67b29af5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Terms of service contract properties. + public partial class TermsOfServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITermsOfServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TermsOfServiceProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TermsOfServiceProperties.json.cs new file mode 100644 index 000000000000..2217d55505a7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITermsOfServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITermsOfServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TokenBodyParameterContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TokenBodyParameterContract.cs new file mode 100644 index 000000000000..2cbc455ecc2b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITokenBodyParameterContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/TokenBodyParameterContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/TokenBodyParameterContract.json.cs new file mode 100644 index 000000000000..ed2572c1cd77 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.ITokenBodyParameterContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.ITokenBodyParameterContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/UserCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserCollection.cs new file mode 100644 index 000000000000..ffb426b7bee2 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Users list representation. + public partial class UserCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/UserCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserCollection.json.cs new file mode 100644 index 000000000000..ad755ad8fb4a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/UserContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserContract.cs new file mode 100644 index 000000000000..61d932c6030b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User details. + public partial class UserContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserContractPropertiesInternal)Property).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserContractPropertiesInternal)Property).FirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContractProperties[] Group { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParametersInternal)Property).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserContractPropertiesInternal)Property).LastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContractProperties[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserContractInternal.Group { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserContractPropertiesInternal)Property).Group; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserContractPropertiesInternal)Property).Group = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)Property).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParametersInternal)Property).Note = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserContractPropertiesInternal)Property).RegistrationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IGroupContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserIdentityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContractProperties[] Group { get; set; } + /// Collection of user identities. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/UserContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserContract.json.cs new file mode 100644 index 000000000000..74dc19309728 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.UserContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/UserContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserContractProperties.cs new file mode 100644 index 000000000000..f97ed34aa037 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User profile. + public partial class UserContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParameters __userEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IGroupContractProperties[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)__userEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IGroupContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/UserContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserContractProperties.json.cs new file mode 100644 index 000000000000..99cae21eac78 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IGroupContractProperties) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.GroupContractProperties.FromJson(__u) )) ))() : null : Group;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/UserCreateParameterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserCreateParameterProperties.cs new file mode 100644 index 000000000000..443bc1f4e2ef --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserCreateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserCreateParameterPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParameters __userEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)__userEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/UserCreateParameterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserCreateParameterProperties.json.cs new file mode 100644 index 000000000000..e2676786284a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserCreateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserCreateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/UserCreateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserCreateParameters.cs new file mode 100644 index 000000000000..6fb2ba6a1dd7 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User create details. + public partial class UserCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserCreateParameterPropertiesInternal)Property).AppType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserCreateParameterPropertiesInternal)Property).Confirmation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserCreateParameterPropertiesInternal)Property).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserCreateParameterPropertiesInternal)Property).FirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParametersInternal)Property).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserCreateParameterPropertiesInternal)Property).LastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserCreateParameterPropertiesInternal)Property).LastName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserCreateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)Property).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserCreateParameterPropertiesInternal)Property).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserCreateParameterPropertiesInternal)Property).Password = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserCreateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserIdentityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/UserCreateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserCreateParameters.json.cs new file mode 100644 index 000000000000..0e64838f7b33 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.UserCreateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/UserEntityBaseParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserEntityBaseParameters.cs new file mode 100644 index 000000000000..dac7443d0430 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User Entity Base Parameters set. + public partial class UserEntityBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IUserIdentityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/UserEntityBaseParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserEntityBaseParameters.json.cs new file mode 100644 index 000000000000..b46b7661b198 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserEntityBaseParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserIdentityContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.UserIdentityContract.FromJson(__u) )) ))() : null : Identity;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/UserIdentityCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserIdentityCollection.cs new file mode 100644 index 000000000000..c7f9ed489f03 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserIdentityCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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.Api20220801.IUserIdentityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserIdentityContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/UserIdentityCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserIdentityCollection.json.cs new file mode 100644 index 000000000000..8ef54fc629ba --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserIdentityCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserIdentityCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserIdentityContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/UserIdentityContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserIdentityContract.cs new file mode 100644 index 000000000000..ed607ee3c815 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User identity details. + public partial class UserIdentityContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserIdentityContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/UserIdentityContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserIdentityContract.json.cs new file mode 100644 index 000000000000..39b17b160dbe --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserIdentityContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserIdentityContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/UserIdentityProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserIdentityProperties.cs new file mode 100644 index 000000000000..83f6cd5a34a4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class UserIdentityProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserIdentityProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/UserIdentityProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserIdentityProperties.json.cs new file mode 100644 index 000000000000..cdb97381c46d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserIdentityProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserIdentityProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/UserTokenParameterProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserTokenParameterProperties.cs new file mode 100644 index 000000000000..670a0273c1fa --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserTokenParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/UserTokenParameterProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserTokenParameterProperties.json.cs new file mode 100644 index 000000000000..9e805c567f9d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserTokenParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserTokenParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/UserTokenParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserTokenParameters.cs new file mode 100644 index 000000000000..c3f90cd13f34 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Get User Token parameters. + public partial class UserTokenParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserTokenParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserTokenParameterPropertiesInternal)Property).Expiry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserTokenParameterPropertiesInternal)Property).KeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserTokenParameterPropertiesInternal)Property).KeyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType)""); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserTokenParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserTokenParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.UserTokenParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserTokenParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserTokenParameterProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/UserTokenParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserTokenParameters.json.cs new file mode 100644 index 000000000000..e39f57b995d8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserTokenParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserTokenParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.UserTokenParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/UserTokenResult.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserTokenResult.cs new file mode 100644 index 000000000000..9e49d5020372 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Get User Token response details. + public partial class UserTokenResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserTokenResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/UserTokenResult.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserTokenResult.json.cs new file mode 100644 index 000000000000..a21d179e8658 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserTokenResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserTokenResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/UserUpdateParameters.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserUpdateParameters.cs new file mode 100644 index 000000000000..ed2ac2ea47db --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User update parameters. + public partial class UserUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserUpdateParametersPropertiesInternal)Property).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserUpdateParametersPropertiesInternal)Property).FirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParametersInternal)Property).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserUpdateParametersPropertiesInternal)Property).LastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserUpdateParametersPropertiesInternal)Property).LastName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserUpdateParametersProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)Property).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserUpdateParametersPropertiesInternal)Property).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserUpdateParametersPropertiesInternal)Property).Password = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserUpdateParametersProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserIdentityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/UserUpdateParameters.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserUpdateParameters.json.cs new file mode 100644 index 000000000000..08c8b70dd745 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.UserUpdateParametersProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/UserUpdateParametersProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserUpdateParametersProperties.cs new file mode 100644 index 000000000000..4dc420f10959 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserUpdateParametersProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserUpdateParametersPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParameters __userEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IUserEntityBaseParametersInternal)__userEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/UserUpdateParametersProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/UserUpdateParametersProperties.json.cs new file mode 100644 index 000000000000..981b30a10560 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IUserUpdateParametersProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IUserUpdateParametersProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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/generated/api/Models/Api20220801/VirtualNetworkConfiguration.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/VirtualNetworkConfiguration.cs new file mode 100644 index 000000000000..461f47a887cd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IVirtualNetworkConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfigurationInternal + { + + /// Internal Acessors for Subnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfigurationInternal.Subnetname { get => this._subnetname; set { {_subnetname = value;} } } + + /// Internal Acessors for Vnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/VirtualNetworkConfiguration.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/VirtualNetworkConfiguration.json.cs new file mode 100644 index 000000000000..248c25a584bd --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IVirtualNetworkConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IVirtualNetworkConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/WikiCollection.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiCollection.cs new file mode 100644 index 000000000000..8947c4c60011 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Wiki list representation. + public partial class WikiCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IWikiCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IWikiContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IWikiContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IWikiContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiCollection.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiCollection.json.cs new file mode 100644 index 000000000000..5e89bae588d1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IWikiCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IWikiContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/WikiContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiContract.cs new file mode 100644 index 000000000000..7305e8f38eab --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiContract.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki properties + public partial class WikiContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api30.IResourceAutoGenerated __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ResourceAutoGenerated(); + + /// 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.Api20220801.IWikiDocumentationContract[] Document { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractPropertiesInternal)Property).Document; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.WikiContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).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.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractProperties _property; + + /// Wiki details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.WikiContractProperties()); set => this._property = value; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType = 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.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType)""); } + + /// + /// 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.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).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.Api20220801.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(__resourceAutoGenerated), __resourceAutoGenerated); + await eventListener.AssertObjectIsValid(nameof(__resourceAutoGenerated), __resourceAutoGenerated); + } + + /// 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.Api30.IResourceAutoGenerated + { + /// 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.Api20220801.IWikiDocumentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api30.IResourceAutoGeneratedInternal + { + /// Collection wiki documents included into this wiki. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiDocumentationContract[] Document { get; set; } + + string ETag { get; set; } + /// Wiki details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiContract.json.cs new file mode 100644 index 000000000000..f67a5a8da366 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IWikiContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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; + } + __resourceAutoGenerated?.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; + } + __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ResourceAutoGenerated(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.WikiContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiContractProperties.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiContractProperties.cs new file mode 100644 index 000000000000..436e7deed0b1 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki contract details + public partial class WikiContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.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.Api20220801.IWikiDocumentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiDocumentationContract[] Document { get; set; } + + } + /// Wiki contract details + internal partial interface IWikiContractPropertiesInternal + + { + /// Collection wiki documents included into this wiki. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiDocumentationContract[] Document { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiContractProperties.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiContractProperties.json.cs new file mode 100644 index 000000000000..f294b66e1e0b --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IWikiContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IWikiDocumentationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.WikiDocumentationContract.FromJson(__u) )) ))() : null : Document;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiDocumentationContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiDocumentationContract.cs new file mode 100644 index 000000000000..614542854344 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki documentation details. + public partial class WikiDocumentationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiDocumentationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/WikiDocumentationContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiDocumentationContract.json.cs new file mode 100644 index 000000000000..befbdb26de19 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IWikiDocumentationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiDocumentationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/WikiUpdateContract.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiUpdateContract.cs new file mode 100644 index 000000000000..eb9c0ee7916a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki update contract details. + public partial class WikiUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IWikiDocumentationContract[] Document { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractPropertiesInternal)Property).Document; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractPropertiesInternal)Property).Document = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.WikiContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractProperties _property; + + /// Wiki details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IWikiDocumentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.IWikiDocumentationContract[] Document { get; set; } + /// Wiki details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiUpdateContract.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/WikiUpdateContract.json.cs new file mode 100644 index 000000000000..96918f726533 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IWikiUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IWikiUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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.Api20220801.WikiContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api20220801/X509CertificateName.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/X509CertificateName.cs new file mode 100644 index 000000000000..3f18d2d81642 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of server X509Names. + public partial class X509CertificateName : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IX509CertificateName, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api20220801/X509CertificateName.json.cs b/swaggerci/apimanagement/generated/api/Models/Api20220801/X509CertificateName.json.cs new file mode 100644 index 000000000000..f6fd1f656b04 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api20220801/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.Api20220801 +{ + 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.Api20220801.IX509CertificateName. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.IX509CertificateName. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20220801.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/generated/api/Models/Api30/ErrorAdditionalInfo.cs b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..7b2dfa712d62 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorAdditionalInfo.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.Api30 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The resource management error additional info. + public partial class ErrorAdditionalInfo : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny _info; + + /// The additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any()); } + + /// Internal Acessors for Info + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any()); set { {_info = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _type; + + /// The additional info type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ErrorAdditionalInfo() + { + + } + } + /// The resource management error additional info. + public partial interface IErrorAdditionalInfo : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The additional info.", + SerializedName = @"info", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Info { get; } + /// The additional info type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The additional info type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The resource management error additional info. + internal partial interface IErrorAdditionalInfoInternal + + { + /// The additional info. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Info { get; set; } + /// The additional info type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api30/ErrorAdditionalInfo.json.cs b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorAdditionalInfo.json.cs new file mode 100644 index 000000000000..ceeaa0f96c1d --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorAdditionalInfo.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; + + /// The resource management error additional info. + public partial class ErrorAdditionalInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 ErrorAdditionalInfo(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;} + {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any.FromJson(__jsonInfo) : Info;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ErrorAdditionalInfo(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 != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._info.ToJson(null,serializationMode) : null, "info" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api30/ErrorDetail.cs b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorDetail.cs new file mode 100644 index 000000000000..de833ceb3823 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorDetail.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.Api30 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The error detail. + public partial class ErrorDetail : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo[] _additionalInfo; + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get => this._additionalInfo; } + + /// Backing field for property. + private string _code; + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail[] _detail; + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail[] Detail { get => this._detail; } + + /// Backing field for property. + private string _message; + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } + + /// Backing field for property. + private string _target; + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Target { get => this._target; } + + /// Creates an new instance. + public ErrorDetail() + { + + } + } + /// The error detail. + public partial interface IErrorDetail : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail[] Detail { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error target.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// The error detail. + internal partial interface IErrorDetailInternal + + { + /// The error additional info. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail[] Detail { get; set; } + /// The error message. + string Message { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api30/ErrorDetail.json.cs b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorDetail.json.cs new file mode 100644 index 000000000000..2d0f315bae69 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorDetail.json.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.Models.Api30 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The error detail. + public partial class ErrorDetail + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 ErrorDetail(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;} + {_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.Api30.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ErrorDetail.FromJson(__u) )) ))() : null : Detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo 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.Api30.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : AdditionalInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ErrorDetail(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._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 ); + } + 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 ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + 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 ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + 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); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._additionalInfo) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._additionalInfo ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("additionalInfo",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api30/ErrorResponseAutoGenerated.cs b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorResponseAutoGenerated.cs new file mode 100644 index 000000000000..d8bc932faeb5 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorResponseAutoGenerated.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; + + /// + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + /// + public partial class ErrorResponseAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorResponseAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorResponseAutoGeneratedInternal + { + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).AdditionalInfo; } + + /// The 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.Api30.IErrorDetailInternal)Error).Code; } + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).Detail; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail _error; + + /// The error object. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ErrorDetail()); set => this._error = value; } + + /// The 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.Api30.IErrorDetailInternal)Error).Message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorResponseAutoGeneratedInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).AdditionalInfo = value; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorResponseAutoGeneratedInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).Code = value; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorResponseAutoGeneratedInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).Detail = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorResponseAutoGeneratedInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ErrorDetail()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorResponseAutoGeneratedInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).Message = value; } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorResponseAutoGeneratedInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).Target = value; } + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetailInternal)Error).Target; } + + /// Creates an new instance. + public ErrorResponseAutoGenerated() + { + + } + } + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + public partial interface IErrorResponseAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail[] Detail { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error target.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + internal partial interface IErrorResponseAutoGeneratedInternal + + { + /// The error additional info. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail[] Detail { get; set; } + /// The error object. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorDetail Error { get; set; } + /// The error message. + string Message { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api30/ErrorResponseAutoGenerated.json.cs b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorResponseAutoGenerated.json.cs new file mode 100644 index 000000000000..c53b1b4df510 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api30/ErrorResponseAutoGenerated.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.Api30 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + /// + public partial class ErrorResponseAutoGenerated + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or 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 ErrorResponseAutoGenerated(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.Api30.ErrorDetail.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorResponseAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorResponseAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IErrorResponseAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ErrorResponseAutoGenerated(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/generated/api/Models/Api30/ProxyResource.cs b/swaggerci/apimanagement/generated/api/Models/Api30/ProxyResource.cs new file mode 100644 index 000000000000..3da98a464908 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api30/ProxyResource.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.Api30 +{ + 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.Api30.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IProxyResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGenerated __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ResourceAutoGenerated(); + + /// + /// 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.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).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.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType = 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.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType)""); } + + /// + /// 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.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).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(__resourceAutoGenerated), __resourceAutoGenerated); + await eventListener.AssertObjectIsValid(nameof(__resourceAutoGenerated), __resourceAutoGenerated); + } + } + /// 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.Api30.IResourceAutoGenerated + { + + } + /// 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.Api30.IResourceAutoGeneratedInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api30/ProxyResource.json.cs b/swaggerci/apimanagement/generated/api/Models/Api30/ProxyResource.json.cs new file mode 100644 index 000000000000..0927d4d90813 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api30/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.Api30 +{ + 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.Api30.IProxyResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IProxyResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.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; + } + __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ResourceAutoGenerated(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; + } + __resourceAutoGenerated?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/Api30/ResourceAutoGenerated.cs b/swaggerci/apimanagement/generated/api/Models/Api30/ResourceAutoGenerated.cs new file mode 100644 index 000000000000..5c31872b1fd3 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api30/ResourceAutoGenerated.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.Api30 +{ + 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 ResourceAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal + { + + /// 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.Api30.IResourceAutoGeneratedInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGeneratedInternal.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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData _systemData; + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [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)""); } + + /// 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 ResourceAutoGenerated() + { + + } + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + public partial interface IResourceAutoGenerated : + 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 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 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 IResourceAutoGeneratedInternal + + { + /// + /// 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; } + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + 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 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/generated/api/Models/Api30/ResourceAutoGenerated.json.cs b/swaggerci/apimanagement/generated/api/Models/Api30/ResourceAutoGenerated.json.cs new file mode 100644 index 000000000000..4e27e063fbc8 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/Api30/ResourceAutoGenerated.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.Api30 +{ + 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 ResourceAutoGenerated + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref 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.IResourceAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.IResourceAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResourceAutoGenerated(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_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 != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,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._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/generated/api/Models/Api30/SystemData.cs b/swaggerci/apimanagement/generated/api/Models/Api30/SystemData.cs new file mode 100644 index 000000000000..a71a5c9c84ec --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/Api30/SystemData.json.cs b/swaggerci/apimanagement/generated/api/Models/Api30/SystemData.json.cs new file mode 100644 index 000000000000..3c7263f45d10 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiDiagnosticGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiDiagnosticGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..815d911434f3 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiDiagnosticGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiDiagnosticGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..076f2c3334a4 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..4bccbf163917 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..6c6db401d034 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiIdentity.cs b/swaggerci/apimanagement/generated/api/Models/ApiIdentity.cs new file mode 100644 index 000000000000..f042592348ff --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/ApiIdentity.cs @@ -0,0 +1,1053 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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 _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 _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 _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 _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 _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. + [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; } + + /// 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; } + /// 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; } + /// + /// 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; } + /// 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; } + /// 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; } + /// + /// 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. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the target subscription.", + 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; } + + } + 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; } + /// 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; } + /// + /// 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; } + /// 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; } + /// 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; } + /// + /// 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. + 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; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement/generated/api/Models/ApiIdentity.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiIdentity.json.cs new file mode 100644 index 000000000000..2993ba1320f4 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Models/ApiIdentity.json.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 +{ + 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;} + {_authsid = If( json?.PropertyT("authsid"), out var __jsonAuthsid) ? (string)__jsonAuthsid : (string)Authsid;} + {_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;} + {_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;} + {_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;} + {_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;} + {_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;} + {_accessName = If( json?.PropertyT("accessName"), out var __jsonAccessName) ? (string)__jsonAccessName : (string)AccessName;} + {_configurationName = If( json?.PropertyT("configurationName"), out var __jsonConfigurationName) ? (string)__jsonConfigurationName : (string)ConfigurationName;} + {_documentationId = If( json?.PropertyT("documentationId"), out var __jsonDocumentationId) ? (string)__jsonDocumentationId : (string)DocumentationId;} + {_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._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._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._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._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._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._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._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._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._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/generated/api/Models/ApiIssueAttachmentGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiIssueAttachmentGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..8cc4379bb06b --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiIssueAttachmentGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiIssueAttachmentGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..3518aa82b2a1 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiIssueCommentGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiIssueCommentGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..590cdc233910 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiIssueCommentGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiIssueCommentGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..a1f6e7377d67 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiIssueGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiIssueGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..cff489ff932c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiIssueGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiIssueGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..b48edcf040d8 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiOperationGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiOperationGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..6804cdd4fb4d --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiOperationGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiOperationGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..e5749ec644de --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiOperationPolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiOperationPolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b1125ff57741 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiOperationPolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiOperationPolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..78417c4a0bd1 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiPolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiPolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..be31605d87bc --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiPolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiPolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..24e385ccbd31 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiReleaseGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiReleaseGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..8e9fd55cef92 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiReleaseGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiReleaseGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9271962675f2 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiSchemaGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiSchemaGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..40dceaeaea87 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiSchemaGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiSchemaGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..cd10e9ae3537 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiTagDescriptionGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiTagDescriptionGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..3e818e6c9578 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiTagDescriptionGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiTagDescriptionGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..28d5ba86e1b8 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiVersionSetGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiVersionSetGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b23762c9f3ee --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiVersionSetGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiVersionSetGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..29c71cc93f82 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiWikiGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ApiWikiGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..074b1678d162 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ApiWikiGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ApiWikiGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..117dd5b456aa --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/AuthorizationConfirmConsentCodeOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/AuthorizationConfirmConsentCodeOkResponseHeaders.cs new file mode 100644 index 000000000000..865ed30fa1de --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/AuthorizationConfirmConsentCodeOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/AuthorizationConfirmConsentCodeOkResponseHeaders.json.cs new file mode 100644 index 000000000000..043877838080 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/AuthorizationServerGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/AuthorizationServerGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..83e774cf0620 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/AuthorizationServerGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/AuthorizationServerGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..415e57f71e03 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/BackendGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/BackendGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..ba4148317d8b --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/BackendGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/BackendGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..7ab0721de33f --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/CacheGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/CacheGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..d19cc440068d --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/CacheGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/CacheGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..3678695ef977 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/CertificateGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/CertificateGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..ee0a3ccefe63 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/CertificateGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/CertificateGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..8fa51dad887f --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ContentItemGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ContentItemGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..aa6cb6657471 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ContentItemGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ContentItemGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9e0327548ae0 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/DelegationSettingsGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/DelegationSettingsGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..33f0df132483 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/DelegationSettingsGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/DelegationSettingsGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..7d9b0617de07 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/DiagnosticGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/DiagnosticGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..d0befd1d5efb --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/DiagnosticGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/DiagnosticGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..a79213a51ea2 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/DocumentationGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/DocumentationGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..08f64fe2e50d --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/DocumentationGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/DocumentationGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..7542c8969a08 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/EmailTemplateGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/EmailTemplateGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b1709a5aacbc --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/EmailTemplateGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/EmailTemplateGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..91aebc5a73d4 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GatewayApiGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/GatewayApiGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..99130f85382a --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GatewayApiGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/GatewayApiGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..1d093ac4b79c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GatewayCertificateAuthorityGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/GatewayCertificateAuthorityGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b3846bf92a06 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GatewayCertificateAuthorityGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/GatewayCertificateAuthorityGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..12dcda442e63 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GatewayGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/GatewayGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..6055db1b8edd --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GatewayGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/GatewayGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..15083cd8ea31 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GatewayHostnameConfigurationGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/GatewayHostnameConfigurationGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b1b0241e172f --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GatewayHostnameConfigurationGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/GatewayHostnameConfigurationGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..a3837b6f9acb --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GlobalSchemaGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/GlobalSchemaGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..f5b15b4d691b --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GlobalSchemaGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/GlobalSchemaGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..e87d34ebf670 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GraphQlApiResolverGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/GraphQlApiResolverGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..79d957849f7a --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GraphQlApiResolverGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/GraphQlApiResolverGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..d45b220babb1 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..a593d1b9c52f --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..521b6ab5db5c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GroupGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/GroupGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..5fad395e807d --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/GroupGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/GroupGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..19809631ecbb --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/IdentityProviderGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/IdentityProviderGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..1e86c95bcd70 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/IdentityProviderGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/IdentityProviderGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9e3e861e4b6d --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/LoggerGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/LoggerGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b2cf42f891c5 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/LoggerGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/LoggerGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9063b21cf42b --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/NamedValueGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/NamedValueGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..6234e00cef14 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/NamedValueGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/NamedValueGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..82de5d837131 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/OpenIdConnectProviderGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/OpenIdConnectProviderGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..c44e6aba374c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/OpenIdConnectProviderGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/OpenIdConnectProviderGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..30d0bbabe53c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/PolicyFragmentGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/PolicyFragmentGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..5365848b23ce --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/PolicyFragmentGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/PolicyFragmentGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..16357db90a7e --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/PolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/PolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..e9691df9b2f0 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/PolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/PolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..258c38f0b60f --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/PortalConfigGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/PortalConfigGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..900b4909686c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/PortalConfigGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/PortalConfigGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..eb6cfd34b0e8 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/PortalRevisionGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/PortalRevisionGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..acb06df385c8 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/PortalRevisionGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/PortalRevisionGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..fcba24ae94a3 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ProductGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ProductGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..ca5922462795 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ProductGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ProductGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..161cc95cf81c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ProductPolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ProductPolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..6d989f200fb4 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ProductPolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ProductPolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..bf259bed8c37 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ProductWikiGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/ProductWikiGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..a8e0b8a69ccc --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/ProductWikiGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/ProductWikiGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9a19acff1540 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/SignInSettingsGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/SignInSettingsGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..2cb5e0f9da78 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/SignInSettingsGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/SignInSettingsGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..c34c69c6b970 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/SignUpSettingsGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/SignUpSettingsGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..8d90a0d53cbf --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/SignUpSettingsGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/SignUpSettingsGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..4b113353fd2d --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/SubscriptionGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/SubscriptionGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..6c7d54658787 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/SubscriptionGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/SubscriptionGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..a371b3642bb3 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/TagGetEntityStateByApiOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/TagGetEntityStateByApiOkResponseHeaders.cs new file mode 100644 index 000000000000..811cc2a524dc --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/TagGetEntityStateByApiOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/TagGetEntityStateByApiOkResponseHeaders.json.cs new file mode 100644 index 000000000000..6c919658dfdb --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/TagGetEntityStateByOperationOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/TagGetEntityStateByOperationOkResponseHeaders.cs new file mode 100644 index 000000000000..2e315c719f9c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/TagGetEntityStateByOperationOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/TagGetEntityStateByOperationOkResponseHeaders.json.cs new file mode 100644 index 000000000000..e5f86f8b5a5f --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/TagGetEntityStateByProductOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/TagGetEntityStateByProductOkResponseHeaders.cs new file mode 100644 index 000000000000..4ddece0b63e2 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/TagGetEntityStateByProductOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/TagGetEntityStateByProductOkResponseHeaders.json.cs new file mode 100644 index 000000000000..86ecabc82880 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/TagGetEntityStateOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/TagGetEntityStateOkResponseHeaders.cs new file mode 100644 index 000000000000..da98faebbc40 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/TagGetEntityStateOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/TagGetEntityStateOkResponseHeaders.json.cs new file mode 100644 index 000000000000..11b0e78885c3 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/TenantAccessGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/TenantAccessGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..22ccdabd93de --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/TenantAccessGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/TenantAccessGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..011b14756c73 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/UserGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement/generated/api/Models/UserGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..8af7ea59faf0 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Models/UserGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement/generated/api/Models/UserGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..96c4314243a1 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/AccessIdName.cs b/swaggerci/apimanagement/generated/api/Support/AccessIdName.cs new file mode 100644 index 000000000000..adb2f59591c6 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/AccessType.cs b/swaggerci/apimanagement/generated/api/Support/AccessType.cs new file mode 100644 index 000000000000..e433b8000ecf --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/AlwaysLog.cs b/swaggerci/apimanagement/generated/api/Support/AlwaysLog.cs new file mode 100644 index 000000000000..179be8cbd1ff --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ApiManagementSkuCapacityScaleType.cs b/swaggerci/apimanagement/generated/api/Support/ApiManagementSkuCapacityScaleType.cs new file mode 100644 index 000000000000..16a231b1542e --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ApiManagementSkuRestrictionsReasonCode.cs b/swaggerci/apimanagement/generated/api/Support/ApiManagementSkuRestrictionsReasonCode.cs new file mode 100644 index 000000000000..ee0600eb5bc6 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ApiManagementSkuRestrictionsType.cs b/swaggerci/apimanagement/generated/api/Support/ApiManagementSkuRestrictionsType.cs new file mode 100644 index 000000000000..e60dafe5d315 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ApiType.cs b/swaggerci/apimanagement/generated/api/Support/ApiType.cs new file mode 100644 index 000000000000..cc9a4cb09317 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Support/ApiType.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 +{ + + /// 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 Http = @"http"; + + 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/generated/api/Support/ApimIdentityType.cs b/swaggerci/apimanagement/generated/api/Support/ApimIdentityType.cs new file mode 100644 index 000000000000..3695711d7785 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/AppType.cs b/swaggerci/apimanagement/generated/api/Support/AppType.cs new file mode 100644 index 000000000000..2eb786245a50 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/AsyncOperationStatus.cs b/swaggerci/apimanagement/generated/api/Support/AsyncOperationStatus.cs new file mode 100644 index 000000000000..ec988e9bdfb9 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/AsyncResolverStatus.cs b/swaggerci/apimanagement/generated/api/Support/AsyncResolverStatus.cs new file mode 100644 index 000000000000..6db73b838fdd --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/AuthorizationMethod.cs b/swaggerci/apimanagement/generated/api/Support/AuthorizationMethod.cs new file mode 100644 index 000000000000..fece50cc382f --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/AuthorizationType.cs b/swaggerci/apimanagement/generated/api/Support/AuthorizationType.cs new file mode 100644 index 000000000000..47b5cb72ff75 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/BackendProtocol.cs b/swaggerci/apimanagement/generated/api/Support/BackendProtocol.cs new file mode 100644 index 000000000000..2bc183a084f3 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/BearerTokenSendingMethod.cs b/swaggerci/apimanagement/generated/api/Support/BearerTokenSendingMethod.cs new file mode 100644 index 000000000000..3fd7b00d9380 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/BearerTokenSendingMethods.cs b/swaggerci/apimanagement/generated/api/Support/BearerTokenSendingMethods.cs new file mode 100644 index 000000000000..26a8facaff8e --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/CertificateSource.cs b/swaggerci/apimanagement/generated/api/Support/CertificateSource.cs new file mode 100644 index 000000000000..3ede40d11ff3 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/CertificateStatus.cs b/swaggerci/apimanagement/generated/api/Support/CertificateStatus.cs new file mode 100644 index 000000000000..96178da9601c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ClientAuthenticationMethod.cs b/swaggerci/apimanagement/generated/api/Support/ClientAuthenticationMethod.cs new file mode 100644 index 000000000000..34f15e511b63 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ConfigurationIdName.cs b/swaggerci/apimanagement/generated/api/Support/ConfigurationIdName.cs new file mode 100644 index 000000000000..5d5e6c4adc7b --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/Confirmation.cs b/swaggerci/apimanagement/generated/api/Support/Confirmation.cs new file mode 100644 index 000000000000..a45269de12e5 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ConnectionStatus.cs b/swaggerci/apimanagement/generated/api/Support/ConnectionStatus.cs new file mode 100644 index 000000000000..94578db8ec30 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ConnectivityCheckProtocol.cs b/swaggerci/apimanagement/generated/api/Support/ConnectivityCheckProtocol.cs new file mode 100644 index 000000000000..b01dfcec820e --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ConnectivityStatusType.cs b/swaggerci/apimanagement/generated/api/Support/ConnectivityStatusType.cs new file mode 100644 index 000000000000..01f204290e40 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ContentFormat.cs b/swaggerci/apimanagement/generated/api/Support/ContentFormat.cs new file mode 100644 index 000000000000..5f5c11208d81 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Support/ContentFormat.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.Support +{ + + /// Format of the Content in which the API is getting imported. + 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 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/generated/api/Support/CreatedByType.cs b/swaggerci/apimanagement/generated/api/Support/CreatedByType.cs new file mode 100644 index 000000000000..fb72049c85ec --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/DataMaskingMode.cs b/swaggerci/apimanagement/generated/api/Support/DataMaskingMode.cs new file mode 100644 index 000000000000..69d61ed7ebda --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ExportFormat.cs b/swaggerci/apimanagement/generated/api/Support/ExportFormat.cs new file mode 100644 index 000000000000..02f290dafd65 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ExportResultFormat.cs b/swaggerci/apimanagement/generated/api/Support/ExportResultFormat.cs new file mode 100644 index 000000000000..dda7ab6b1157 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/GrantType.cs b/swaggerci/apimanagement/generated/api/Support/GrantType.cs new file mode 100644 index 000000000000..31be9da2c564 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/GroupType.cs b/swaggerci/apimanagement/generated/api/Support/GroupType.cs new file mode 100644 index 000000000000..637b42fdf3ad --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/HostnameType.cs b/swaggerci/apimanagement/generated/api/Support/HostnameType.cs new file mode 100644 index 000000000000..ca6057382bf6 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Support/HostnameType.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 +{ + + /// Hostname type. + public partial struct HostnameType : + System.IEquatable + { + 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/generated/api/Support/HttpCorrelationProtocol.cs b/swaggerci/apimanagement/generated/api/Support/HttpCorrelationProtocol.cs new file mode 100644 index 000000000000..59a34b2dc71b --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/IdentityProviderType.cs b/swaggerci/apimanagement/generated/api/Support/IdentityProviderType.cs new file mode 100644 index 000000000000..b468cf210bd8 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/IssueType.cs b/swaggerci/apimanagement/generated/api/Support/IssueType.cs new file mode 100644 index 000000000000..752bddea869e --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/KeyType.cs b/swaggerci/apimanagement/generated/api/Support/KeyType.cs new file mode 100644 index 000000000000..8280474e1435 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/LoggerType.cs b/swaggerci/apimanagement/generated/api/Support/LoggerType.cs new file mode 100644 index 000000000000..dc8304d0f5eb --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/Method.cs b/swaggerci/apimanagement/generated/api/Support/Method.cs new file mode 100644 index 000000000000..51d95c8172ba --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/NameAvailabilityReason.cs b/swaggerci/apimanagement/generated/api/Support/NameAvailabilityReason.cs new file mode 100644 index 000000000000..5fc7540d0e45 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/NatGatewayState.cs b/swaggerci/apimanagement/generated/api/Support/NatGatewayState.cs new file mode 100644 index 000000000000..a1ad10a9e582 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/NotificationName.cs b/swaggerci/apimanagement/generated/api/Support/NotificationName.cs new file mode 100644 index 000000000000..e9a030653565 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/OAuth2GrantType.cs b/swaggerci/apimanagement/generated/api/Support/OAuth2GrantType.cs new file mode 100644 index 000000000000..453c4491f2ed --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/OperationNameFormat.cs b/swaggerci/apimanagement/generated/api/Support/OperationNameFormat.cs new file mode 100644 index 000000000000..5330be28b309 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/Origin.cs b/swaggerci/apimanagement/generated/api/Support/Origin.cs new file mode 100644 index 000000000000..eae2949fce1c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/PlatformVersion.cs b/swaggerci/apimanagement/generated/api/Support/PlatformVersion.cs new file mode 100644 index 000000000000..d9c523e93f4a --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Support/PlatformVersion.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 +{ + + /// 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 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/generated/api/Support/PolicyContentFormat.cs b/swaggerci/apimanagement/generated/api/Support/PolicyContentFormat.cs new file mode 100644 index 000000000000..78701ff82a36 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/PolicyExportFormat.cs b/swaggerci/apimanagement/generated/api/Support/PolicyExportFormat.cs new file mode 100644 index 000000000000..f78de578e286 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/PolicyFragmentContentFormat.cs b/swaggerci/apimanagement/generated/api/Support/PolicyFragmentContentFormat.cs new file mode 100644 index 000000000000..9430e16b0fe6 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/PolicyIdName.cs b/swaggerci/apimanagement/generated/api/Support/PolicyIdName.cs new file mode 100644 index 000000000000..ffd642cf81a4 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/PolicyScopeContract.cs b/swaggerci/apimanagement/generated/api/Support/PolicyScopeContract.cs new file mode 100644 index 000000000000..f8c2bdcd26e9 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/PortalRevisionStatus.cs b/swaggerci/apimanagement/generated/api/Support/PortalRevisionStatus.cs new file mode 100644 index 000000000000..7be0b51654ad --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/PortalSettingsCspMode.cs b/swaggerci/apimanagement/generated/api/Support/PortalSettingsCspMode.cs new file mode 100644 index 000000000000..b8556ad7b6a9 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/PreferredIPVersion.cs b/swaggerci/apimanagement/generated/api/Support/PreferredIPVersion.cs new file mode 100644 index 000000000000..ddc7fbf4da75 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs b/swaggerci/apimanagement/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 000000000000..188109457e07 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs b/swaggerci/apimanagement/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 000000000000..507d1e12fa10 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ProductState.cs b/swaggerci/apimanagement/generated/api/Support/ProductState.cs new file mode 100644 index 000000000000..dbfd8a71f3bb --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/Protocol.cs b/swaggerci/apimanagement/generated/api/Support/Protocol.cs new file mode 100644 index 000000000000..fbf150dff9d8 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ProvisioningState.cs b/swaggerci/apimanagement/generated/api/Support/ProvisioningState.cs new file mode 100644 index 000000000000..67cdf001651c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/PublicNetworkAccess.cs b/swaggerci/apimanagement/generated/api/Support/PublicNetworkAccess.cs new file mode 100644 index 000000000000..08cecd02ceab --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/ResourceSkuCapacityScaleType.cs b/swaggerci/apimanagement/generated/api/Support/ResourceSkuCapacityScaleType.cs new file mode 100644 index 000000000000..4956237aeb22 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/SamplingType.cs b/swaggerci/apimanagement/generated/api/Support/SamplingType.cs new file mode 100644 index 000000000000..ad42103a026a --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/SchemaType.cs b/swaggerci/apimanagement/generated/api/Support/SchemaType.cs new file mode 100644 index 000000000000..0ca5cb4fb89a --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/SettingsTypeName.cs b/swaggerci/apimanagement/generated/api/Support/SettingsTypeName.cs new file mode 100644 index 000000000000..7e3bf544e883 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/Severity.cs b/swaggerci/apimanagement/generated/api/Support/Severity.cs new file mode 100644 index 000000000000..8dbc5d53da11 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/SkuType.cs b/swaggerci/apimanagement/generated/api/Support/SkuType.cs new file mode 100644 index 000000000000..73f46738b027 --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Support/SkuType.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 +{ + + /// 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"; + + /// 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"; + + /// 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/generated/api/Support/SoapApiType.cs b/swaggerci/apimanagement/generated/api/Support/SoapApiType.cs new file mode 100644 index 000000000000..e29260c7e88f --- /dev/null +++ b/swaggerci/apimanagement/generated/api/Support/SoapApiType.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 +{ + + /// + /// 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. + /// + 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 a SOAP API having a RESTful front end. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType Http = @"http"; + + /// 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/generated/api/Support/State.cs b/swaggerci/apimanagement/generated/api/Support/State.cs new file mode 100644 index 000000000000..6805475da03a --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/SubscriptionState.cs b/swaggerci/apimanagement/generated/api/Support/SubscriptionState.cs new file mode 100644 index 000000000000..f9653b465ac6 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/TemplateName.cs b/swaggerci/apimanagement/generated/api/Support/TemplateName.cs new file mode 100644 index 000000000000..db9aba892225 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/TranslateRequiredQueryParametersConduct.cs b/swaggerci/apimanagement/generated/api/Support/TranslateRequiredQueryParametersConduct.cs new file mode 100644 index 000000000000..fd47195c2e6e --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/UserState.cs b/swaggerci/apimanagement/generated/api/Support/UserState.cs new file mode 100644 index 000000000000..e5ee8bd2734c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/Verbosity.cs b/swaggerci/apimanagement/generated/api/Support/Verbosity.cs new file mode 100644 index 000000000000..8b14b5b59a88 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/VersioningScheme.cs b/swaggerci/apimanagement/generated/api/Support/VersioningScheme.cs new file mode 100644 index 000000000000..c19920bc7150 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/api/Support/VirtualNetworkType.cs b/swaggerci/apimanagement/generated/api/Support/VirtualNetworkType.cs new file mode 100644 index 000000000000..9a1488b20679 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/CmdInfoHandler.cs b/swaggerci/apimanagement/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..713803f2b870 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/ConversionException.cs b/swaggerci/apimanagement/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..40afa6b8dd95 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..20291119c8f2 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..22369361046c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..e45bd6f2942c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..146bb4b0d0dd --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..27beaafd6d16 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..de99099c95d5 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..09fd3412b71a --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..f24fea174dbb --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..435aa17bd264 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..b1b24db55d40 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..c779d38a60ae --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..b78afb1beb69 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..86d07ebd6b3b --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..00ff8bc08578 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..ca3e3181db8c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..320d2762a43a --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..c5308fc03fb9 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..3ca4df61ec4d --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..be84f02134fb --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..034f10f1b8a7 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..2a5a4052facc --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..af807f7fc3e1 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..f30bb5738cf4 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/apimanagement/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..266cd4a25d44 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/apimanagement/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..871a36005780 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/apimanagement/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..465a2dad2988 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/apimanagement/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..99435bbaebe6 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Customizations/JsonArray.cs b/swaggerci/apimanagement/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..3974fcaa36e7 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/apimanagement/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..2284235e800b --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Customizations/JsonNode.cs b/swaggerci/apimanagement/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..c8dfb086100a --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/apimanagement/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..5df1675401b3 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Customizations/JsonObject.cs b/swaggerci/apimanagement/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..4d46b4972034 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Customizations/JsonString.cs b/swaggerci/apimanagement/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..15bb993a4fcc --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/apimanagement/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..b54538ed137a --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/EventData.cs b/swaggerci/apimanagement/generated/runtime/EventData.cs new file mode 100644 index 000000000000..f65d9e28c50e --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/EventListener.cs b/swaggerci/apimanagement/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..eb581f4d8c34 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Events.cs b/swaggerci/apimanagement/generated/runtime/Events.cs new file mode 100644 index 000000000000..bbb4688cbcc6 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Extensions.cs b/swaggerci/apimanagement/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..2948c04c2506 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/apimanagement/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..968839296ccd --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/apimanagement/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..ffff6794f1f3 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Helpers/Seperator.cs b/swaggerci/apimanagement/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..de8522a0a450 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/apimanagement/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..583aa9485563 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Helpers/XHelper.cs b/swaggerci/apimanagement/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..dc536755fb9b --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/IAssociativeArray.cs b/swaggerci/apimanagement/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..ca98ced22f1b --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/IHeaderSerializable.cs b/swaggerci/apimanagement/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..67db70682048 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/ISendAsync.cs b/swaggerci/apimanagement/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..1951373dcf9c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/InfoAttribute.cs b/swaggerci/apimanagement/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..a54aaf9bca9b --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Iso/IsoDate.cs b/swaggerci/apimanagement/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..861f943b24a7 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/JsonType.cs b/swaggerci/apimanagement/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..5a924dea1209 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Method.cs b/swaggerci/apimanagement/generated/runtime/Method.cs new file mode 100644 index 000000000000..880b33940059 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Models/JsonMember.cs b/swaggerci/apimanagement/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..e3018cf77e3c --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Models/JsonModel.cs b/swaggerci/apimanagement/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..df361c4422be --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Models/JsonModelCache.cs b/swaggerci/apimanagement/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..37cdf0031c35 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/apimanagement/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..8a8040df105f --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/apimanagement/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..048ae9e66314 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/apimanagement/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..9689878f5e32 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/apimanagement/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..fad2df12e9df --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/apimanagement/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..932f166a88df --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/apimanagement/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..aae7d73603d4 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/JsonDate.cs b/swaggerci/apimanagement/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..360c0f893afc --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/JsonNode.cs b/swaggerci/apimanagement/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..268ce29e09c0 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/apimanagement/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..2b3157b938eb --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/JsonObject.cs b/swaggerci/apimanagement/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..ec1d7efeaded --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/JsonString.cs b/swaggerci/apimanagement/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..aa6efbc6c147 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/XBinary.cs b/swaggerci/apimanagement/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..9fd0587b0b18 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Nodes/XNull.cs b/swaggerci/apimanagement/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..a6c133fc9450 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/apimanagement/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..907055a92d85 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Parser/JsonParser.cs b/swaggerci/apimanagement/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..eae774b46af7 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Parser/JsonToken.cs b/swaggerci/apimanagement/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..a07a775aab84 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/apimanagement/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..6663e10d11e8 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Parser/Location.cs b/swaggerci/apimanagement/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..965a7ce7fa23 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/apimanagement/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..2a41cd6923f3 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Parser/TokenReader.cs b/swaggerci/apimanagement/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..d7531fac7803 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/PipelineMocking.cs b/swaggerci/apimanagement/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..bc1624dcb52d --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Response.cs b/swaggerci/apimanagement/generated/runtime/Response.cs new file mode 100644 index 000000000000..a9d5f321063f --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/apimanagement/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..502e98ad4add --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/apimanagement/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..1b88c1bcc2fa --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/apimanagement/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..015b0bfc62aa --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/SerializationMode.cs b/swaggerci/apimanagement/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..5487daca5105 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/UndeclaredResponseException.cs b/swaggerci/apimanagement/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..5d864d6018cf --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/Writers/JsonWriter.cs b/swaggerci/apimanagement/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..d0f185d521f4 --- /dev/null +++ b/swaggerci/apimanagement/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/generated/runtime/delegates.cs b/swaggerci/apimanagement/generated/runtime/delegates.cs new file mode 100644 index 000000000000..8af78b082f94 --- /dev/null +++ b/swaggerci/apimanagement/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/readme.md b/swaggerci/apimanagement/readme.md new file mode 100644 index 000000000000..24a0f33758b2 --- /dev/null +++ b/swaggerci/apimanagement/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 +```