diff --git a/src/Monitor/ActionGroup.Autorest/README.md b/src/Monitor/ActionGroup.Autorest/README.md
index 0480107bfe72..f2010109fdc9 100644
--- a/src/Monitor/ActionGroup.Autorest/README.md
+++ b/src/Monitor/ActionGroup.Autorest/README.md
@@ -34,7 +34,7 @@ For information on how to develop for `Az.ActionGroup`, see [how-to.md](how-to.m
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
-branch: 47d1d82108a0db0395ed4eca106622becee7fbb4
+commit: 47d1d82108a0db0395ed4eca106622becee7fbb4
input-file:
- $(repo)/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/actionGroups_API.json
diff --git a/src/Monitor/ActionGroup.Autorest/generate-portal-ux.ps1 b/src/Monitor/ActionGroup.Autorest/generate-portal-ux.ps1
index e02b236853e2..eedd8ebd548f 100644
--- a/src/Monitor/ActionGroup.Autorest/generate-portal-ux.ps1
+++ b/src/Monitor/ActionGroup.Autorest/generate-portal-ux.ps1
@@ -42,8 +42,6 @@ $instance = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module]::Ins
$moduleInfo = Get-Module -Name $moduleName
$parameterSetsInfo = Get-Module -Name "$moduleName.private"
-$buildinFunctions = @("Export-CmdletSurface", "Export-ExampleStub", "Export-FormatPs1xml", "Export-HelpMarkdown", "Export-ModelSurface", "Export-ProxyCmdlet", "Export-Psd1", "Export-TestStub", "Get-CommonParameter", "Get-ModuleGuid", "Get-ScriptCmdlet")
-
function Test-FunctionSupported()
{
[CmdletBinding()]
@@ -53,12 +51,12 @@ function Test-FunctionSupported()
$FunctionName
)
- If ($buildinfunctions.Contains($FunctionName)) {
+ If (-not $FunctionName.Contains("_")) {
return $false
}
$cmdletName, $parameterSetName = $FunctionName.Split("_")
- If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity")) {
+ If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity") -or $parameterSetName.Contains("ViaJson")) {
return $false
}
If ($cmdletName.StartsWith("New") -or $cmdletName.StartsWith("Set") -or $cmdletName.StartsWith("Update")) {
@@ -311,7 +309,7 @@ function New-MetadataForCmdlet()
return $result
}
-$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-functionSupported($_) }
+$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-FunctionSupported($_) }
$resourceTypes = @{}
foreach ($parameterSetName in $parameterSets)
{
diff --git a/src/Monitor/ActionGroup.Autorest/generated/Module.cs b/src/Monitor/ActionGroup.Autorest/generated/Module.cs
index 3f19b92ba425..c5d2f600b6a9 100644
--- a/src/Monitor/ActionGroup.Autorest/generated/Module.cs
+++ b/src/Monitor/ActionGroup.Autorest/generated/Module.cs
@@ -26,12 +26,20 @@ public partial class Module
public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler();
+ private static bool _init = false;
+
+ private static readonly global::System.Object _initLock = new global::System.Object();
+
+ private static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module _instance;
+
/// the ISendAsync pipeline instance
private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.HttpPipeline _pipeline;
/// the ISendAsync pipeline instance (when proxy is enabled)
private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.HttpPipeline _pipelineWithProxy;
+ private static readonly global::System.Object _singletonLock = new global::System.Object();
+
public bool _useProxy = false;
public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy();
@@ -51,11 +59,8 @@ public partial class Module
/// The delegate to get the telemetry Id.
public GetTelemetryIdDelegate GetTelemetryId { get; set; }
- /// Backing field for property.
- private static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module _instance;
-
/// the singleton of this module class
- public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module());
+ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } }
/// The Name of this module
public string Name => @"Az.ActionGroup";
@@ -117,9 +122,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.HttpPipeli
/// Initialization steps performed after the module is loaded.
public void Init()
{
- OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } );
- OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } );
- CustomInit();
+ if (_init == false)
+ {
+ lock (_initLock) {
+ if (_init == false) {
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } );
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } );
+ CustomInit();
+ _init = true;
+ }
+ }
+ }
}
/// Creates the module instance.
diff --git a/src/Monitor/ActionGroup.Autorest/generated/api/ActionGroup.cs b/src/Monitor/ActionGroup.Autorest/generated/api/ActionGroup.cs
index 3b7ccff1fc2c..e3637eb09f24 100644
--- a/src/Monitor/ActionGroup.Autorest/generated/api/ActionGroup.cs
+++ b/src/Monitor/ActionGroup.Autorest/generated/api/ActionGroup.cs
@@ -1293,7 +1293,6 @@ public partial class ActionGroup
/// The name of the action group.
/// The receiver to re-enable.
/// a delegate that is called when the remote service returns 200 (OK).
- /// a delegate that is called when the remote service returns 409 (Conflict).
/// a delegate that is called when the remote service returns default (any response code not handled
/// elsewhere).
/// an instance that will receive events.
@@ -1302,7 +1301,7 @@ public partial class ActionGroup
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiver(string subscriptionId, string resourceGroupName, string actionGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IEnableRequest body, global::System.Func onOk, global::System.Func onConflict, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeUpdate)
+ public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiver(string subscriptionId, string resourceGroupName, string actionGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IEnableRequest body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeUpdate)
{
var apiVersion = @"2023-01-01";
// Constant Parameters
@@ -1334,7 +1333,7 @@ public partial class ActionGroup
request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.ActionGroupsEnableReceiver_Call (request, onOk,onConflict,onDefault,eventListener,sender);
+ await this.ActionGroupsEnableReceiver_Call (request, onOk,onDefault,eventListener,sender);
}
}
@@ -1345,7 +1344,6 @@ public partial class ActionGroup
///
/// The receiver to re-enable.
/// a delegate that is called when the remote service returns 200 (OK).
- /// a delegate that is called when the remote service returns 409 (Conflict).
/// a delegate that is called when the remote service returns default (any response code not handled
/// elsewhere).
/// an instance that will receive events.
@@ -1354,7 +1352,7 @@ public partial class ActionGroup
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiverViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IEnableRequest body, global::System.Func onOk, global::System.Func onConflict, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeUpdate)
+ public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiverViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.IEnableRequest body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.SerializationMode.IncludeUpdate)
{
var apiVersion = @"2023-01-01";
// Constant Parameters
@@ -1398,7 +1396,7 @@ public partial class ActionGroup
request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.ActionGroupsEnableReceiver_Call (request, onOk,onConflict,onDefault,eventListener,sender);
+ await this.ActionGroupsEnableReceiver_Call (request, onOk,onDefault,eventListener,sender);
}
}
@@ -1411,7 +1409,6 @@ public partial class ActionGroup
/// The name of the action group.
/// Json string supplied to the ActionGroupsEnableReceiver operation
/// a delegate that is called when the remote service returns 200 (OK).
- /// a delegate that is called when the remote service returns 409 (Conflict).
/// a delegate that is called when the remote service returns default (any response code not handled
/// elsewhere).
/// an instance that will receive events.
@@ -1419,7 +1416,7 @@ public partial class ActionGroup
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiverViaJsonString(string subscriptionId, string resourceGroupName, string actionGroupName, global::System.String jsonString, global::System.Func onOk, global::System.Func onConflict, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task ActionGroupsEnableReceiverViaJsonString(string subscriptionId, string resourceGroupName, string actionGroupName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender)
{
var apiVersion = @"2023-01-01";
// Constant Parameters
@@ -1451,14 +1448,13 @@ public partial class ActionGroup
request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.ActionGroupsEnableReceiver_Call (request, onOk,onConflict,onDefault,eventListener,sender);
+ await this.ActionGroupsEnableReceiver_Call (request, onOk,onDefault,eventListener,sender);
}
}
/// Actual wire call for method.
/// the prepared HttpRequestMessage to send.
/// a delegate that is called when the remote service returns 200 (OK).
- /// a delegate that is called when the remote service returns 409 (Conflict).
/// a delegate that is called when the remote service returns default (any response code not handled
/// elsewhere).
/// an instance that will receive events.
@@ -1466,7 +1462,7 @@ public partial class ActionGroup
///
/// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task ActionGroupsEnableReceiver_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onConflict, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender)
+ internal async global::System.Threading.Tasks.Task ActionGroupsEnableReceiver_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.ISendAsync sender)
{
using( NoSynchronizationContext )
{
@@ -1488,12 +1484,6 @@ public partial class ActionGroup
await onOk(_response);
break;
}
- case global::System.Net.HttpStatusCode.Conflict:
- {
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onConflict(_response);
- break;
- }
default:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
diff --git a/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableExpanded.cs b/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableExpanded.cs
index 32fc3a82cbc5..3c72185d93e7 100644
--- a/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableExpanded.cs
+++ b/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableExpanded.cs
@@ -188,16 +188,6 @@ public partial class EnableAzActionGroupReceiver_EnableExpanded : global::System
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ParameterCategory.Path)]
public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; }
- ///
- /// overrideOnConflict will be called before the regular onConflict has been processed, allowing customization of what
- /// happens on that response. Implement this method in a partial class to enable this behavior
- ///
- /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
- /// /// Determines if the rest of the onConflict method should be processed, or if the method should
- /// return immediately (set to true to skip further processing )
-
- partial void overrideOnConflict(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow);
-
///
/// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what
/// happens on that response. Implement this method in a partial class to enable this behavior
@@ -395,7 +385,7 @@ protected override void ProcessRecord()
try
{
await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
- await this.Client.ActionGroupsEnableReceiver(SubscriptionId, ResourceGroupName, ActionGroupName, _enableRequestBody, onOk, onConflict, onDefault, this, Pipeline);
+ await this.Client.ActionGroupsEnableReceiver(SubscriptionId, ResourceGroupName, ActionGroupName, _enableRequestBody, onOk, onDefault, this, Pipeline);
await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
}
catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.UndeclaredResponseException urexception)
@@ -419,30 +409,6 @@ protected override void StopProcessing()
base.StopProcessing();
}
- /// a delegate that is called when the remote service returns 409 (Conflict).
- /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
- ///
- /// A that will be complete when handling of the method is completed.
- ///
- private async global::System.Threading.Tasks.Task onConflict(global::System.Net.Http.HttpResponseMessage responseMessage)
- {
- using( NoSynchronizationContext )
- {
- var _returnNow = global::System.Threading.Tasks.Task.FromResult(false);
- overrideOnConflict(responseMessage, ref _returnNow);
- // if overrideOnConflict has returned true, then return right away.
- if ((null != _returnNow && await _returnNow))
- {
- return ;
- }
- // onConflict - response for 409 /
- if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru"))
- {
- WriteObject(true);
- }
- }
- }
-
///
/// a delegate that is called when the remote service returns default (any response code not handled elsewhere).
///
diff --git a/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaIdentityExpanded.cs b/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaIdentityExpanded.cs
index 0c0186e2fc66..dc11aecd8844 100644
--- a/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaIdentityExpanded.cs
+++ b/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaIdentityExpanded.cs
@@ -149,16 +149,6 @@ public partial class EnableAzActionGroupReceiver_EnableViaIdentityExpanded : glo
PossibleTypes = new [] { typeof(string) })]
public string ReceiverName { get => _enableRequestBody.ReceiverName ?? null; set => _enableRequestBody.ReceiverName = value; }
- ///
- /// overrideOnConflict will be called before the regular onConflict has been processed, allowing customization of what
- /// happens on that response. Implement this method in a partial class to enable this behavior
- ///
- /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
- /// /// Determines if the rest of the onConflict method should be processed, or if the method should
- /// return immediately (set to true to skip further processing )
-
- partial void overrideOnConflict(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow);
-
///
/// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what
/// happens on that response. Implement this method in a partial class to enable this behavior
@@ -358,7 +348,7 @@ protected override void ProcessRecord()
await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
if (InputObject?.Id != null)
{
- await this.Client.ActionGroupsEnableReceiverViaIdentity(InputObject.Id, _enableRequestBody, onOk, onConflict, onDefault, this, Pipeline);
+ await this.Client.ActionGroupsEnableReceiverViaIdentity(InputObject.Id, _enableRequestBody, onOk, onDefault, this, Pipeline);
}
else
{
@@ -375,7 +365,7 @@ protected override void ProcessRecord()
{
ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ActionGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) );
}
- await this.Client.ActionGroupsEnableReceiver(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ActionGroupName ?? null, _enableRequestBody, onOk, onConflict, onDefault, this, Pipeline);
+ await this.Client.ActionGroupsEnableReceiver(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ActionGroupName ?? null, _enableRequestBody, onOk, onDefault, this, Pipeline);
}
await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
}
@@ -400,30 +390,6 @@ protected override void StopProcessing()
base.StopProcessing();
}
- /// a delegate that is called when the remote service returns 409 (Conflict).
- /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
- ///
- /// A that will be complete when handling of the method is completed.
- ///
- private async global::System.Threading.Tasks.Task onConflict(global::System.Net.Http.HttpResponseMessage responseMessage)
- {
- using( NoSynchronizationContext )
- {
- var _returnNow = global::System.Threading.Tasks.Task.FromResult(false);
- overrideOnConflict(responseMessage, ref _returnNow);
- // if overrideOnConflict has returned true, then return right away.
- if ((null != _returnNow && await _returnNow))
- {
- return ;
- }
- // onConflict - response for 409 /
- if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru"))
- {
- WriteObject(true);
- }
- }
- }
-
///
/// a delegate that is called when the remote service returns default (any response code not handled elsewhere).
///
diff --git a/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonFilePath.cs b/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonFilePath.cs
index aaada250d2f2..dfa137988e02 100644
--- a/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonFilePath.cs
+++ b/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonFilePath.cs
@@ -190,16 +190,6 @@ public partial class EnableAzActionGroupReceiver_EnableViaJsonFilePath : global:
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ParameterCategory.Path)]
public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; }
- ///
- /// overrideOnConflict will be called before the regular onConflict has been processed, allowing customization of what
- /// happens on that response. Implement this method in a partial class to enable this behavior
- ///
- /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
- /// /// Determines if the rest of the onConflict method should be processed, or if the method should
- /// return immediately (set to true to skip further processing )
-
- partial void overrideOnConflict(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow);
-
///
/// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what
/// happens on that response. Implement this method in a partial class to enable this behavior
@@ -397,7 +387,7 @@ protected override void ProcessRecord()
try
{
await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
- await this.Client.ActionGroupsEnableReceiverViaJsonString(SubscriptionId, ResourceGroupName, ActionGroupName, _jsonString, onOk, onConflict, onDefault, this, Pipeline);
+ await this.Client.ActionGroupsEnableReceiverViaJsonString(SubscriptionId, ResourceGroupName, ActionGroupName, _jsonString, onOk, onDefault, this, Pipeline);
await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
}
catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.UndeclaredResponseException urexception)
@@ -421,30 +411,6 @@ protected override void StopProcessing()
base.StopProcessing();
}
- /// a delegate that is called when the remote service returns 409 (Conflict).
- /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
- ///
- /// A that will be complete when handling of the method is completed.
- ///
- private async global::System.Threading.Tasks.Task onConflict(global::System.Net.Http.HttpResponseMessage responseMessage)
- {
- using( NoSynchronizationContext )
- {
- var _returnNow = global::System.Threading.Tasks.Task.FromResult(false);
- overrideOnConflict(responseMessage, ref _returnNow);
- // if overrideOnConflict has returned true, then return right away.
- if ((null != _returnNow && await _returnNow))
- {
- return ;
- }
- // onConflict - response for 409 /
- if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru"))
- {
- WriteObject(true);
- }
- }
- }
-
///
/// a delegate that is called when the remote service returns default (any response code not handled elsewhere).
///
diff --git a/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonString.cs b/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonString.cs
index d478b6092907..9916f679f681 100644
--- a/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonString.cs
+++ b/src/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonString.cs
@@ -188,16 +188,6 @@ public partial class EnableAzActionGroupReceiver_EnableViaJsonString : global::S
[global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ParameterCategory.Path)]
public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; }
- ///
- /// overrideOnConflict will be called before the regular onConflict has been processed, allowing customization of what
- /// happens on that response. Implement this method in a partial class to enable this behavior
- ///
- /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
- /// /// Determines if the rest of the onConflict method should be processed, or if the method should
- /// return immediately (set to true to skip further processing )
-
- partial void overrideOnConflict(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow);
-
///
/// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what
/// happens on that response. Implement this method in a partial class to enable this behavior
@@ -395,7 +385,7 @@ protected override void ProcessRecord()
try
{
await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
- await this.Client.ActionGroupsEnableReceiverViaJsonString(SubscriptionId, ResourceGroupName, ActionGroupName, _jsonString, onOk, onConflict, onDefault, this, Pipeline);
+ await this.Client.ActionGroupsEnableReceiverViaJsonString(SubscriptionId, ResourceGroupName, ActionGroupName, _jsonString, onOk, onDefault, this, Pipeline);
await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
}
catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime.UndeclaredResponseException urexception)
@@ -419,30 +409,6 @@ protected override void StopProcessing()
base.StopProcessing();
}
- /// a delegate that is called when the remote service returns 409 (Conflict).
- /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
- ///
- /// A that will be complete when handling of the method is completed.
- ///
- private async global::System.Threading.Tasks.Task onConflict(global::System.Net.Http.HttpResponseMessage responseMessage)
- {
- using( NoSynchronizationContext )
- {
- var _returnNow = global::System.Threading.Tasks.Task.FromResult(false);
- overrideOnConflict(responseMessage, ref _returnNow);
- // if overrideOnConflict has returned true, then return right away.
- if ((null != _returnNow && await _returnNow))
- {
- return ;
- }
- // onConflict - response for 409 /
- if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru"))
- {
- WriteObject(true);
- }
- }
- }
-
///
/// a delegate that is called when the remote service returns default (any response code not handled elsewhere).
///
diff --git a/src/Monitor/ActionGroup.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/src/Monitor/ActionGroup.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs
index 87aeb28a2d61..cac4e5a1cfdd 100644
--- a/src/Monitor/ActionGroup.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs
+++ b/src/Monitor/ActionGroup.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs
@@ -56,6 +56,31 @@ protected override void ProcessRecord()
return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_})
}
}
+function Start-TestSleep {
+ [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')]
+ param(
+ [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')]
+ [ValidateRange(0.0, 2147483.0)]
+ [double] $Seconds,
+
+ [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')]
+ [ValidateRange('NonNegative')]
+ [Alias('ms')]
+ [int] $Milliseconds
+ )
+
+ if ($TestMode -ne 'playback') {
+ switch ($PSCmdlet.ParameterSetName) {
+ 'SleepBySeconds' {
+ Start-Sleep -Seconds $Seconds
+ }
+ 'SleepByMilliseconds' {
+ Start-Sleep -Milliseconds $Milliseconds
+ }
+ }
+ }
+}
+
$env = @{}
if ($UsePreviousConfigForRecord) {
$previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json
diff --git a/src/Monitor/ActionGroup.Autorest/test/Enable-AzActionGroupReceiver.Recording.json b/src/Monitor/ActionGroup.Autorest/test/Enable-AzActionGroupReceiver.Recording.json
index cad4c4403a1d..415fc3ce7657 100644
--- a/src/Monitor/ActionGroup.Autorest/test/Enable-AzActionGroupReceiver.Recording.json
+++ b/src/Monitor/ActionGroup.Autorest/test/Enable-AzActionGroupReceiver.Recording.json
@@ -17,19 +17,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "bed8f3e7-6d2e-4d84-a9b7-b440bfe27658" ],
+ "X-ActivityId": [ "9b6af2d6-a94d-42ea-b711-a12978ee3327" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN2AZNS000005" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
"x-ms-ratelimit-remaining-subscription-writes": [ "1199" ],
- "x-ms-request-id": [ "67462913-8ec2-43f2-97fc-56e91f8bd45f" ],
- "x-ms-correlation-request-id": [ "67462913-8ec2-43f2-97fc-56e91f8bd45f" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053833Z:67462913-8ec2-43f2-97fc-56e91f8bd45f" ],
+ "x-ms-request-id": [ "7ae1f2a6-edc5-4090-b483-587dfa9444b0" ],
+ "x-ms-correlation-request-id": [ "7ae1f2a6-edc5-4090-b483-587dfa9444b0" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084834Z:7ae1f2a6-edc5-4090-b483-587dfa9444b0" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:33 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 0A6BDA0052414F6FA3138C9654DC4E10 Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:32Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:48:34 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "156" ],
@@ -47,12 +48,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "5" ],
- "x-ms-client-request-id": [ "6dec28d8-b20a-482a-a339-d8378099d5a5" ],
+ "x-ms-unique-id": [ "8" ],
+ "x-ms-client-request-id": [ "88d6c762-ffc9-4310-9efa-898aabfaa28b" ],
"CommandName": [ "Get-AzActionGroup" ],
"FullCommandName": [ "Get-AzActionGroup_Get" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -63,19 +64,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "6dec28d8-b20a-482a-a339-d8378099d5a5" ],
+ "X-ActivityId": [ "88d6c762-ffc9-4310-9efa-898aabfaa28b" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN2AZNS000007" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
"x-ms-ratelimit-remaining-subscription-resource-requests": [ "249" ],
- "x-ms-request-id": [ "3bd50f72-aa0b-4390-a375-e30f5555ee0a" ],
- "x-ms-correlation-request-id": [ "3bd50f72-aa0b-4390-a375-e30f5555ee0a" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053834Z:3bd50f72-aa0b-4390-a375-e30f5555ee0a" ],
+ "x-ms-request-id": [ "f827b29f-5f42-444b-acdb-5325adc7bea9" ],
+ "x-ms-correlation-request-id": [ "f827b29f-5f42-444b-acdb-5325adc7bea9" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084836Z:f827b29f-5f42-444b-acdb-5325adc7bea9" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:34 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 662AEEFE427947F8868907FCE56BA4AB Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:34Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:48:36 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "777" ],
@@ -104,19 +106,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "e173494b-ac91-4386-b8d8-40a6556acc6c" ],
+ "X-ActivityId": [ "e7014e5a-a668-46c0-ac5b-cf952afdaf1a" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN2AZNS000008" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-writes": [ "1198" ],
- "x-ms-request-id": [ "08559265-1150-41df-aad8-73c7d374943f" ],
- "x-ms-correlation-request-id": [ "08559265-1150-41df-aad8-73c7d374943f" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053835Z:08559265-1150-41df-aad8-73c7d374943f" ],
+ "x-ms-ratelimit-remaining-subscription-writes": [ "1199" ],
+ "x-ms-request-id": [ "7181cfdd-c2a5-4635-b8c4-a581ad858419" ],
+ "x-ms-correlation-request-id": [ "7181cfdd-c2a5-4635-b8c4-a581ad858419" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084839Z:7181cfdd-c2a5-4635-b8c4-a581ad858419" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:34 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 082BF55A3386421BB43FF609C6C1DF7C Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:37Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:48:39 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "159" ],
diff --git a/src/Monitor/ActionGroup.Autorest/test/Enable-AzActionGroupReceiver.Tests.ps1 b/src/Monitor/ActionGroup.Autorest/test/Enable-AzActionGroupReceiver.Tests.ps1
index 7659bc2617ab..3589f811dcee 100644
--- a/src/Monitor/ActionGroup.Autorest/test/Enable-AzActionGroupReceiver.Tests.ps1
+++ b/src/Monitor/ActionGroup.Autorest/test/Enable-AzActionGroupReceiver.Tests.ps1
@@ -17,8 +17,9 @@ if(($null -eq $TestName) -or ($TestName -contains 'Enable-AzActionGroupReceiver'
Describe 'Enable-AzActionGroupReceiver' {
It 'EnableExpanded' {
{
+ # Receiver with name smsreceiver in action group with Id MONITOR:xx is already enabled
Enable-AzActionGroupReceiver -ActionGroupName $env.actiongroupname -ResourceGroupName $env.resourceGroup -ReceiverName $env.smsreceiver
- } | Should -Not -Throw
+ } | Should -Throw "is already enabled"
}
It 'EnableViaJsonString' -skip {
@@ -30,9 +31,10 @@ Describe 'Enable-AzActionGroupReceiver' {
}
It 'EnableViaIdentityExpanded' {
- {
+ {
+ # Receiver with name smsreceiver in action group with Id MONITOR:xx is already enabled
$ag = Get-AzActionGroup -Name $env.actiongroupname -ResourceGroupName $env.resourceGroup
Enable-AzActionGroupReceiver -InputObject $ag -ReceiverName $env.emailreceiver1
- } | Should -Not -Throw
+ } | Should -Throw "is already enabled"
}
}
diff --git a/src/Monitor/ActionGroup.Autorest/test/Get-AzActionGroup.Recording.json b/src/Monitor/ActionGroup.Autorest/test/Get-AzActionGroup.Recording.json
index aec28199e257..f4d5909b1ee9 100644
--- a/src/Monitor/ActionGroup.Autorest/test/Get-AzActionGroup.Recording.json
+++ b/src/Monitor/ActionGroup.Autorest/test/Get-AzActionGroup.Recording.json
@@ -17,19 +17,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "e714c76d-dc94-4536-aec7-32d51edd2eca" ],
+ "X-ActivityId": [ "cbd787cd-1fa2-4a61-bb74-9eb8491a0dc1" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "CH1AZNS000005" ],
+ "X-ServedBy": [ "CH1AZNS000006" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "23" ],
- "x-ms-request-id": [ "67f88dc8-6e84-4f8d-b597-a4786f31aa0e" ],
- "x-ms-correlation-request-id": [ "67f88dc8-6e84-4f8d-b597-a4786f31aa0e" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053838Z:67f88dc8-6e84-4f8d-b597-a4786f31aa0e" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "24" ],
+ "x-ms-request-id": [ "4d64f2b9-9691-4097-b028-95bdc18f0d16" ],
+ "x-ms-correlation-request-id": [ "4d64f2b9-9691-4097-b028-95bdc18f0d16" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084846Z:4d64f2b9-9691-4097-b028-95bdc18f0d16" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:37 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: DE248713EFA24C498570167ADF8447A4 Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:42Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:48:46 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "573" ],
@@ -47,12 +48,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "8" ],
- "x-ms-client-request-id": [ "4ad3d97c-0140-4310-abc9-a22171dbf1de" ],
+ "x-ms-unique-id": [ "11" ],
+ "x-ms-client-request-id": [ "6c9989a3-e973-4093-ac9c-b4b3a8b14d2d" ],
"CommandName": [ "Get-AzActionGroup" ],
"FullCommandName": [ "Get-AzActionGroup_GetViaIdentity" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -63,19 +64,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "4ad3d97c-0140-4310-abc9-a22171dbf1de" ],
+ "X-ActivityId": [ "6c9989a3-e973-4093-ac9c-b4b3a8b14d2d" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "CH1AZNS000005" ],
+ "X-ServedBy": [ "ch1azns000007" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "248" ],
- "x-ms-request-id": [ "fa875157-8860-4fa7-81c7-5866f4074756" ],
- "x-ms-correlation-request-id": [ "fa875157-8860-4fa7-81c7-5866f4074756" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053838Z:fa875157-8860-4fa7-81c7-5866f4074756" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "249" ],
+ "x-ms-request-id": [ "7b900da6-eccf-404d-91fc-1bf8f34f37cb" ],
+ "x-ms-correlation-request-id": [ "7b900da6-eccf-404d-91fc-1bf8f34f37cb" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084848Z:7b900da6-eccf-404d-91fc-1bf8f34f37cb" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:38 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 33EB4875A5354D4B950357F2840E77E5 Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:46Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:48:48 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "573" ],
@@ -93,12 +95,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "9" ],
- "x-ms-client-request-id": [ "f1d49871-61b6-4c6b-9c86-89790a35be52" ],
+ "x-ms-unique-id": [ "12" ],
+ "x-ms-client-request-id": [ "4d8318b1-3d05-4c55-bf01-334a369b8d96" ],
"CommandName": [ "Get-AzActionGroup" ],
"FullCommandName": [ "Get-AzActionGroup_List" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -110,20 +112,22 @@
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
"x-ms-original-request-ids": [ "", "", "" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "247" ],
- "x-ms-request-id": [ "49f1f1d7-8035-4a96-a8cf-d72131e95dbf" ],
- "x-ms-correlation-request-id": [ "49f1f1d7-8035-4a96-a8cf-d72131e95dbf" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053840Z:49f1f1d7-8035-4a96-a8cf-d72131e95dbf" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "249" ],
+ "x-ms-request-id": [ "55055a62-fc8b-4fee-b002-eda694657e5a" ],
+ "x-ms-correlation-request-id": [ "55055a62-fc8b-4fee-b002-eda694657e5a" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084851Z:55055a62-fc8b-4fee-b002-eda694657e5a" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:40 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 47E53490113C436892D57DF208E3D438 Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:48Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:48:50 GMT" ]
},
"ContentHeaders": {
+ "Content-Length": [ "2215" ],
"Content-Type": [ "application/json; charset=utf-8" ],
- "Expires": [ "-1" ],
- "Content-Length": [ "2887" ]
+ "Expires": [ "-1" ]
},
- "Content": "{\"value\":[{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/wyunchi-copilot-application-insights/providers/microsoft.insights/actionGroups/Application Insights Smart Detection\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"Application Insights Smart Detection\",\"location\":\"Global\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"SmartDetect\",\"enabled\":true,\"emailReceivers\":[],\"smsReceivers\":[],\"webhookReceivers\":[],\"eventHubReceivers\":[],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[{\"name\":\"Monitoring Contributor\",\"roleId\":\"749f88d5-cbae-40b8-bcfc-e573ddc772fa\",\"useCommonAlertSchema\":true},{\"name\":\"Monitoring Reader\",\"roleId\":\"43d0d8ad-25c7-4714-9337-8ba259a9fe05\",\"useCommonAlertSchema\":true}]}},{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroup3\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroup3\",\"location\":\"northcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag3\",\"enabled\":false,\"emailReceivers\":[],\"smsReceivers\":[],\"webhookReceivers\":[],\"eventHubReceivers\":[],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}},{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-Action/providers/microsoft.insights/actionGroups/actiongroup1\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroup1\",\"location\":\"southcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[{\"name\":\"user1\",\"emailAddress\":\"v-jiaji@microsoft.com\",\"useCommonAlertSchema\":false,\"status\":\"Enabled\"}],\"smsReceivers\":[],\"webhookReceivers\":[],\"eventHubReceivers\":[],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}},{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroupGet\",\"location\":\"southcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[{\"name\":\"emailreceiver1\",\"emailAddress\":\"v-jiaji@microsoft.com\",\"useCommonAlertSchema\":false,\"status\":\"Enabled\"}],\"smsReceivers\":[{\"name\":\"smsreceiver\",\"countryCode\":\"86\",\"phoneNumber\":\"18964587446\",\"status\":\"Enabled\"}],\"webhookReceivers\":[],\"eventHubReceivers\":[],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}}]}",
+ "Content": "{\"value\":[{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/wyunchi-copilot-application-insights/providers/microsoft.insights/actionGroups/Application Insights Smart Detection\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"Application Insights Smart Detection\",\"location\":\"Global\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"SmartDetect\",\"enabled\":true,\"emailReceivers\":[],\"smsReceivers\":[],\"webhookReceivers\":[],\"eventHubReceivers\":[],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[{\"name\":\"Monitoring Contributor\",\"roleId\":\"749f88d5-cbae-40b8-bcfc-e573ddc772fa\",\"useCommonAlertSchema\":true},{\"name\":\"Monitoring Reader\",\"roleId\":\"43d0d8ad-25c7-4714-9337-8ba259a9fe05\",\"useCommonAlertSchema\":true}]}},{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroup3\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroup3\",\"location\":\"northcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag3\",\"enabled\":false,\"emailReceivers\":[],\"smsReceivers\":[],\"webhookReceivers\":[],\"eventHubReceivers\":[],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}},{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroupGet\",\"location\":\"southcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[{\"name\":\"emailreceiver1\",\"emailAddress\":\"v-jiaji@microsoft.com\",\"useCommonAlertSchema\":false,\"status\":\"Enabled\"}],\"smsReceivers\":[{\"name\":\"smsreceiver\",\"countryCode\":\"86\",\"phoneNumber\":\"18964587446\",\"status\":\"Enabled\"}],\"webhookReceivers\":[],\"eventHubReceivers\":[],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}}]}",
"isContentBase64": false
}
},
@@ -134,12 +138,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "10" ],
- "x-ms-client-request-id": [ "c7f597dc-6225-43d6-be36-82e124f0e9ed" ],
+ "x-ms-unique-id": [ "13" ],
+ "x-ms-client-request-id": [ "3ef577c4-2802-49fa-8095-417ff6379376" ],
"CommandName": [ "Get-AzActionGroup" ],
"FullCommandName": [ "Get-AzActionGroup_Get" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -150,19 +154,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "c7f597dc-6225-43d6-be36-82e124f0e9ed" ],
+ "X-ActivityId": [ "3ef577c4-2802-49fa-8095-417ff6379376" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN2AZNS000002" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "246" ],
- "x-ms-request-id": [ "2d3e8480-9a6e-4930-9b3f-5e2890b9ad5f" ],
- "x-ms-correlation-request-id": [ "2d3e8480-9a6e-4930-9b3f-5e2890b9ad5f" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053841Z:2d3e8480-9a6e-4930-9b3f-5e2890b9ad5f" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "249" ],
+ "x-ms-request-id": [ "67726346-e54a-45a9-b59c-45f2d4496221" ],
+ "x-ms-correlation-request-id": [ "67726346-e54a-45a9-b59c-45f2d4496221" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084853Z:67726346-e54a-45a9-b59c-45f2d4496221" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:40 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: C925FE14818743188B46C123E24FA824 Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:52Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:48:53 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "777" ],
@@ -180,12 +185,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "11" ],
- "x-ms-client-request-id": [ "5bf3758b-854c-4130-9693-6a8939d6db2e" ],
+ "x-ms-unique-id": [ "14" ],
+ "x-ms-client-request-id": [ "a9e69b53-8087-40f6-9492-e56048613a03" ],
"CommandName": [ "Get-AzActionGroup" ],
"FullCommandName": [ "Get-AzActionGroup_List1" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -197,18 +202,20 @@
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
"x-ms-original-request-ids": [ "", "" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "245" ],
- "x-ms-request-id": [ "53f46be1-e56f-433f-8d44-faed5e314679" ],
- "x-ms-correlation-request-id": [ "53f46be1-e56f-433f-8d44-faed5e314679" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053841Z:53f46be1-e56f-433f-8d44-faed5e314679" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "249" ],
+ "x-ms-request-id": [ "f9dccb7e-3956-4cca-8d72-6a959e363553" ],
+ "x-ms-correlation-request-id": [ "f9dccb7e-3956-4cca-8d72-6a959e363553" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084856Z:f9dccb7e-3956-4cca-8d72-6a959e363553" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:41 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 68B023B4742F4A0FB9BA350383EA501A Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:54Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:48:56 GMT" ]
},
"ContentHeaders": {
+ "Content-Length": [ "1363" ],
"Content-Type": [ "application/json; charset=utf-8" ],
- "Expires": [ "-1" ],
- "Content-Length": [ "1363" ]
+ "Expires": [ "-1" ]
},
"Content": "{\"value\":[{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroup3\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroup3\",\"location\":\"northcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag3\",\"enabled\":false,\"emailReceivers\":[],\"smsReceivers\":[],\"webhookReceivers\":[],\"eventHubReceivers\":[],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}},{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroupGet\",\"location\":\"southcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[{\"name\":\"emailreceiver1\",\"emailAddress\":\"v-jiaji@microsoft.com\",\"useCommonAlertSchema\":false,\"status\":\"Enabled\"}],\"smsReceivers\":[{\"name\":\"smsreceiver\",\"countryCode\":\"86\",\"phoneNumber\":\"18964587446\",\"status\":\"Enabled\"}],\"webhookReceivers\":[],\"eventHubReceivers\":[],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}}]}",
"isContentBase64": false
diff --git a/src/Monitor/ActionGroup.Autorest/test/New-AzActionGroup.Recording.json b/src/Monitor/ActionGroup.Autorest/test/New-AzActionGroup.Recording.json
index 9bcff80a1b43..a7db9582d6fd 100644
--- a/src/Monitor/ActionGroup.Autorest/test/New-AzActionGroup.Recording.json
+++ b/src/Monitor/ActionGroup.Autorest/test/New-AzActionGroup.Recording.json
@@ -3,13 +3,13 @@
"Request": {
"Method": "PUT",
"RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/Microsoft.Insights/actionGroups/actiongroup1?api-version=2023-01-01",
- "Content": "{\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"groupShortName\": \"ag1\",\r\n \"enabled\": false,\r\n \"eventHubReceivers\": [\r\n {\r\n \"name\": \"sample eventhub\",\r\n \"eventHubNameSpace\": \"Namespace1894859101\",\r\n \"eventHubName\": \"testEventHub452586681\",\r\n \"subscriptionId\": \"9e223dbe-3399-4e19-88eb-0975f02ac87f\"\r\n }\r\n ]\r\n }\r\n}",
+ "Content": "{\r\n \"location\": \"northcentralus\",\r\n \"properties\": {\r\n \"groupShortName\": \"ag1\",\r\n \"enabled\": false,\r\n \"eventHubReceivers\": [\r\n {\r\n \"name\": \"sample eventhub\",\r\n \"eventHubNameSpace\": \"Namespace20240204\",\r\n \"eventHubName\": \"testEventHub20240204\",\r\n \"subscriptionId\": \"9e223dbe-3399-4e19-88eb-0975f02ac87f\"\r\n }\r\n ]\r\n }\r\n}",
"isContentBase64": false,
"Headers": {
},
"ContentHeaders": {
"Content-Type": [ "application/json" ],
- "Content-Length": [ "372" ]
+ "Content-Length": [ "369" ]
}
},
"Response": {
@@ -17,26 +17,27 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "7d36e6fe-26bd-4154-8a3e-a8ca1cfb939a" ],
+ "X-ActivityId": [ "d5072741-8ff0-479b-b615-00bb03f2cfc5" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "CH1AZNS000005" ],
+ "X-ServedBy": [ "CH1AZNS000004" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "22" ],
- "x-ms-request-id": [ "aa800d9a-c003-41fb-9334-7daab488f4e4" ],
- "x-ms-correlation-request-id": [ "aa800d9a-c003-41fb-9334-7daab488f4e4" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053843Z:aa800d9a-c003-41fb-9334-7daab488f4e4" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "24" ],
+ "x-ms-request-id": [ "ad734759-1621-4505-bfe5-96555194ffd4" ],
+ "x-ms-correlation-request-id": [ "ad734759-1621-4505-bfe5-96555194ffd4" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084859Z:ad734759-1621-4505-bfe5-96555194ffd4" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:42 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: F1019506F3484D06A89DFF9B29932C7E Ref B: MAA201060514051 Ref C: 2024-02-04T08:48:56Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:48:59 GMT" ]
},
"ContentHeaders": {
- "Content-Length": [ "815" ],
+ "Content-Length": [ "812" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
- "Content": "{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroup1\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroup1\",\"location\":\"northcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[],\"smsReceivers\":[],\"webhookReceivers\":[],\"eventHubReceivers\":[{\"name\":\"sample eventhub\",\"subscriptionId\":\"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\"eventHubNameSpace\":\"Namespace1894859101\",\"eventHubName\":\"testEventHub452586681\",\"useCommonAlertSchema\":false,\"tenantId\":\"72f988bf-86f1-41af-91ab-2d7cd011db47\"}],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}}",
+ "Content": "{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroup1\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroup1\",\"location\":\"northcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[],\"smsReceivers\":[],\"webhookReceivers\":[],\"eventHubReceivers\":[{\"name\":\"sample eventhub\",\"subscriptionId\":\"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\"eventHubNameSpace\":\"Namespace20240204\",\"eventHubName\":\"testEventHub20240204\",\"useCommonAlertSchema\":false,\"tenantId\":\"72f988bf-86f1-41af-91ab-2d7cd011db47\"}],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}}",
"isContentBase64": false
}
}
diff --git a/src/Monitor/ActionGroup.Autorest/test/Remove-AzActionGroup.Recording.json b/src/Monitor/ActionGroup.Autorest/test/Remove-AzActionGroup.Recording.json
index b78b581f9d9d..11eeef32a27e 100644
--- a/src/Monitor/ActionGroup.Autorest/test/Remove-AzActionGroup.Recording.json
+++ b/src/Monitor/ActionGroup.Autorest/test/Remove-AzActionGroup.Recording.json
@@ -6,12 +6,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "13" ],
- "x-ms-client-request-id": [ "f8125c07-6755-4efb-ab2b-5895e256a900" ],
+ "x-ms-unique-id": [ "16" ],
+ "x-ms-client-request-id": [ "24599428-6835-493d-b38e-4f0de16469c8" ],
"CommandName": [ "Remove-AzActionGroup" ],
"FullCommandName": [ "Remove-AzActionGroup_Delete" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -22,19 +22,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "f8125c07-6755-4efb-ab2b-5895e256a900" ],
+ "X-ActivityId": [ "24599428-6835-493d-b38e-4f0de16469c8" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "CH1AZNS000005" ],
+ "X-ServedBy": [ "ch1azns000007" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
"x-ms-ratelimit-remaining-subscription-deletes": [ "14999" ],
- "x-ms-request-id": [ "1ec8b42e-dab6-4740-8a6b-e3a285c4914d" ],
- "x-ms-correlation-request-id": [ "1ec8b42e-dab6-4740-8a6b-e3a285c4914d" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053846Z:1ec8b42e-dab6-4740-8a6b-e3a285c4914d" ],
+ "x-ms-request-id": [ "a1e93846-051e-4b04-a3f8-92cc4bec0eeb" ],
+ "x-ms-correlation-request-id": [ "a1e93846-051e-4b04-a3f8-92cc4bec0eeb" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084905Z:a1e93846-051e-4b04-a3f8-92cc4bec0eeb" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:46 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: A99178AE40344A06867F3577C8E379B0 Ref B: MAA201060514051 Ref C: 2024-02-04T08:49:02Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:49:05 GMT" ]
},
"ContentHeaders": {
"Expires": [ "-1" ],
@@ -51,12 +52,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "14" ],
- "x-ms-client-request-id": [ "f8ee106f-90a9-4605-9d86-1824abebe883" ],
+ "x-ms-unique-id": [ "17" ],
+ "x-ms-client-request-id": [ "61723e49-6f4a-4751-9547-64922b525a83" ],
"CommandName": [ "Get-AzActionGroup" ],
"FullCommandName": [ "Get-AzActionGroup_Get" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -67,19 +68,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "f8ee106f-90a9-4605-9d86-1824abebe883" ],
+ "X-ActivityId": [ "61723e49-6f4a-4751-9547-64922b525a83" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "CH1AZNS000005" ],
+ "X-ServedBy": [ "CH1AZNS000006" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "244" ],
- "x-ms-request-id": [ "1becebbd-c1ba-4e48-b30b-405b235e3245" ],
- "x-ms-correlation-request-id": [ "1becebbd-c1ba-4e48-b30b-405b235e3245" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053848Z:1becebbd-c1ba-4e48-b30b-405b235e3245" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "249" ],
+ "x-ms-request-id": [ "fef59fee-ed67-4ce7-8124-e38424c679b7" ],
+ "x-ms-correlation-request-id": [ "fef59fee-ed67-4ce7-8124-e38424c679b7" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084908Z:fef59fee-ed67-4ce7-8124-e38424c679b7" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:47 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 79EFE615137D4B74953FC64DA9710421 Ref B: MAA201060514051 Ref C: 2024-02-04T08:49:05Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:49:07 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "573" ],
@@ -97,12 +99,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "15" ],
- "x-ms-client-request-id": [ "addc63a2-41a6-4f39-a7fa-c04023ba0a9a" ],
+ "x-ms-unique-id": [ "18" ],
+ "x-ms-client-request-id": [ "a5b4d6f6-befc-4509-a62e-4ccef7d074b7" ],
"CommandName": [ "Remove-AzActionGroup" ],
"FullCommandName": [ "Remove-AzActionGroup_DeleteViaIdentity" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -113,19 +115,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "addc63a2-41a6-4f39-a7fa-c04023ba0a9a" ],
+ "X-ActivityId": [ "a5b4d6f6-befc-4509-a62e-4ccef7d074b7" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "CH1AZNS000005" ],
+ "X-ServedBy": [ "CH2AZNS000001" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-deletes": [ "14998" ],
- "x-ms-request-id": [ "e2bc25df-b6aa-4990-92c2-8f7605d45f08" ],
- "x-ms-correlation-request-id": [ "e2bc25df-b6aa-4990-92c2-8f7605d45f08" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053849Z:e2bc25df-b6aa-4990-92c2-8f7605d45f08" ],
+ "x-ms-ratelimit-remaining-subscription-deletes": [ "14999" ],
+ "x-ms-request-id": [ "e0636991-4580-4201-8055-9ec9a00c3067" ],
+ "x-ms-correlation-request-id": [ "e0636991-4580-4201-8055-9ec9a00c3067" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084912Z:e0636991-4580-4201-8055-9ec9a00c3067" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:49 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 67FC737267C844BAA1C76DB2135E96C3 Ref B: MAA201060514051 Ref C: 2024-02-04T08:49:08Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:49:12 GMT" ]
},
"ContentHeaders": {
"Expires": [ "-1" ],
diff --git a/src/Monitor/ActionGroup.Autorest/test/Test-AzActionGroup.Recording.json b/src/Monitor/ActionGroup.Autorest/test/Test-AzActionGroup.Recording.json
index d83715b9c215..4df8df856fa7 100644
--- a/src/Monitor/ActionGroup.Autorest/test/Test-AzActionGroup.Recording.json
+++ b/src/Monitor/ActionGroup.Autorest/test/Test-AzActionGroup.Recording.json
@@ -17,20 +17,21 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "Location": [ "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774239?api-version=2023-01-01" ],
- "X-ActivityId": [ "4e20e3f9-25e9-4ede-bc65-181a0db43222" ],
+ "Location": [ "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000019269460?api-version=2023-01-01\u0026t=638426333554858866\u0026c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo\u0026s=gOdJxIOIH5iX085fFrSDfP4oDVfQHAbhAMCcaZlbBxW4Cw_JqHH8bSlIRah4z_zmCZzqNfWzbzWjs2dwJMgpkX0rO6LxtxBxOOaSbGxnl3uWK0QA-Ak5SW4Yk8TycJK2KIAXiRqa_JKCYetjq9XQp9l7vLyFFwTV6auuO7hjilI-7Gfdwu-ZtW3UK92Nkc4DFdOF4foQUfslGImHSpyEYmcWTCQAIIqtiBARy0cRapnjH-B5SCDDpDY7ffH5De26FZJpZxz9-FLgsGWDxBg1148OUV-ONTtPoN4x_jB8E8a54L54AeuNwRCXTS6R6Ep8LVozAHIKXLWbC7QVtCJ2YA\u0026h=XvkPJ15qxzvhKoafv2huXoYL4-5Po8CAhMFkIsiropo" ],
+ "X-ActivityId": [ "51129958-f62a-4aa7-85bc-2190bcbefba8" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN2AZNS000003" ],
"api-supported-versions": [ "2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-writes": [ "1197" ],
- "x-ms-request-id": [ "72f06d01-fdaf-4e2d-a355-b261f7d6a7c7" ],
- "x-ms-correlation-request-id": [ "72f06d01-fdaf-4e2d-a355-b261f7d6a7c7" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053850Z:72f06d01-fdaf-4e2d-a355-b261f7d6a7c7" ],
+ "x-ms-ratelimit-remaining-subscription-writes": [ "1199" ],
+ "x-ms-request-id": [ "a52b354d-178d-4077-9442-9bc4470efb79" ],
+ "x-ms-correlation-request-id": [ "a52b354d-178d-4077-9442-9bc4470efb79" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084915Z:a52b354d-178d-4077-9442-9bc4470efb79" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:38:50 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 0264D68B22A04392B8689472BA197C8C Ref B: MAA201060514051 Ref C: 2024-02-04T08:49:13Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:49:15 GMT" ]
},
"ContentHeaders": {
"Expires": [ "-1" ],
@@ -40,20 +41,20 @@
"isContentBase64": false
}
},
- "Test-AzActionGroup+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774239?api-version=2023-01-01+2": {
+ "Test-AzActionGroup+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000019269460?api-version=2023-01-01\u0026t=638426333554858866\u0026c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo\u0026s=gOdJxIOIH5iX085fFrSDfP4oDVfQHAbhAMCcaZlbBxW4Cw_JqHH8bSlIRah4z_zmCZzqNfWzbzWjs2dwJMgpkX0rO6LxtxBxOOaSbGxnl3uWK0QA-Ak5SW4Yk8TycJK2KIAXiRqa_JKCYetjq9XQp9l7vLyFFwTV6auuO7hjilI-7Gfdwu-ZtW3UK92Nkc4DFdOF4foQUfslGImHSpyEYmcWTCQAIIqtiBARy0cRapnjH-B5SCDDpDY7ffH5De26FZJpZxz9-FLgsGWDxBg1148OUV-ONTtPoN4x_jB8E8a54L54AeuNwRCXTS6R6Ep8LVozAHIKXLWbC7QVtCJ2YA\u0026h=XvkPJ15qxzvhKoafv2huXoYL4-5Po8CAhMFkIsiropo+2": {
"Request": {
"Method": "GET",
- "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774239?api-version=2023-01-01",
+ "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000019269460?api-version=2023-01-01\u0026t=638426333554858866\u0026c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo\u0026s=gOdJxIOIH5iX085fFrSDfP4oDVfQHAbhAMCcaZlbBxW4Cw_JqHH8bSlIRah4z_zmCZzqNfWzbzWjs2dwJMgpkX0rO6LxtxBxOOaSbGxnl3uWK0QA-Ak5SW4Yk8TycJK2KIAXiRqa_JKCYetjq9XQp9l7vLyFFwTV6auuO7hjilI-7Gfdwu-ZtW3UK92Nkc4DFdOF4foQUfslGImHSpyEYmcWTCQAIIqtiBARy0cRapnjH-B5SCDDpDY7ffH5De26FZJpZxz9-FLgsGWDxBg1148OUV-ONTtPoN4x_jB8E8a54L54AeuNwRCXTS6R6Ep8LVozAHIKXLWbC7QVtCJ2YA\u0026h=XvkPJ15qxzvhKoafv2huXoYL4-5Po8CAhMFkIsiropo",
"Content": null,
"isContentBase64": false,
"Headers": {
"Authorization": [ "[Filtered]" ],
- "x-ms-unique-id": [ "17" ],
- "x-ms-client-request-id": [ "4e20e3f9-25e9-4ede-bc65-181a0db43222" ],
+ "x-ms-unique-id": [ "20" ],
+ "x-ms-client-request-id": [ "51129958-f62a-4aa7-85bc-2190bcbefba8" ],
"CommandName": [ "Az.ActionGroup.internal\\Test-AzActionGroup" ],
"FullCommandName": [ "Test-AzActionGroup_CreateExpanded" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ]
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ]
},
"ContentHeaders": {
}
@@ -63,135 +64,44 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "4e20e3f9-25e9-4ede-bc65-181a0db43222" ],
+ "X-ActivityId": [ "51129958-f62a-4aa7-85bc-2190bcbefba8" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN1AZNS000003" ],
"api-supported-versions": [ "2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
"x-ms-ratelimit-remaining-subscription-reads": [ "11999" ],
- "x-ms-request-id": [ "cc964d76-41ee-4130-a34f-71b227a43610" ],
- "x-ms-correlation-request-id": [ "cc964d76-41ee-4130-a34f-71b227a43610" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053921Z:cc964d76-41ee-4130-a34f-71b227a43610" ],
- "X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:39:21 GMT" ]
- },
- "ContentHeaders": {
- "Content-Length": [ "564" ],
- "Content-Type": [ "application/json; charset=utf-8" ],
- "Expires": [ "-1" ]
- },
- "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"InProgress\",\"completedTime\":\"0001-01-01T00:00:00+00:00\",\"createdTime\":\"2023-11-08T05:38:50.5790286+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"InProgress\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:39:00.7436042+00:00\",\"Message\":null},{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver2\",\"Status\":\"InProgress\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:39:00.7436042+00:00\",\"Message\":null}]}",
- "isContentBase64": false
- }
- },
- "Test-AzActionGroup+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774239?api-version=2023-01-01+3": {
- "Request": {
- "Method": "GET",
- "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774239?api-version=2023-01-01",
- "Content": null,
- "isContentBase64": false,
- "Headers": {
- "Authorization": [ "[Filtered]" ],
- "x-ms-unique-id": [ "18" ],
- "x-ms-client-request-id": [ "4e20e3f9-25e9-4ede-bc65-181a0db43222" ],
- "CommandName": [ "Az.ActionGroup.internal\\Test-AzActionGroup" ],
- "FullCommandName": [ "Test-AzActionGroup_CreateExpanded" ],
- "ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ]
- },
- "ContentHeaders": {
- }
- },
- "Response": {
- "StatusCode": 202,
- "Headers": {
- "Cache-Control": [ "no-cache" ],
- "Pragma": [ "no-cache" ],
- "X-ActivityId": [ "4e20e3f9-25e9-4ede-bc65-181a0db43222" ],
- "Access-Control-Expose-Headers": [ "x-activityid" ],
- "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
- "X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
- "api-supported-versions": [ "2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-reads": [ "11998" ],
- "x-ms-request-id": [ "ca0c564b-4d3a-427c-8859-8bd3489a4823" ],
- "x-ms-correlation-request-id": [ "ca0c564b-4d3a-427c-8859-8bd3489a4823" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T053952Z:ca0c564b-4d3a-427c-8859-8bd3489a4823" ],
+ "x-ms-request-id": [ "27cb875c-20b4-4d9d-985c-2314ed86aff3" ],
+ "x-ms-correlation-request-id": [ "27cb875c-20b4-4d9d-985c-2314ed86aff3" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T084947Z:27cb875c-20b4-4d9d-985c-2314ed86aff3" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:39:51 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 95F4D839C6AB463398412B7B84241C52 Ref B: MAA201060514051 Ref C: 2024-02-04T08:49:45Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:49:47 GMT" ]
},
"ContentHeaders": {
- "Content-Length": [ "564" ],
+ "Content-Length": [ "556" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
- "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"InProgress\",\"completedTime\":\"0001-01-01T00:00:00+00:00\",\"createdTime\":\"2023-11-08T05:38:50.5790286+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"InProgress\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:39:00.7436042+00:00\",\"Message\":null},{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver2\",\"Status\":\"InProgress\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:39:00.7436042+00:00\",\"Message\":null}]}",
+ "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextIdType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"InProgress\",\"completedTime\":\"0001-01-01T00:00:00+00:00\",\"createdTime\":\"2024-02-04T08:49:15.3189122+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"InProgress\",\"SubState\":null,\"SendTime\":\"2024-02-04T08:49:16.0622321+00:00\",\"Message\":null},{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver2\",\"Status\":\"InProgress\",\"SubState\":null,\"SendTime\":\"2024-02-04T08:49:16.0622321+00:00\",\"Message\":null}]}",
"isContentBase64": false
}
},
- "Test-AzActionGroup+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774239?api-version=2023-01-01+4": {
+ "Test-AzActionGroup+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000019269460?api-version=2023-01-01\u0026t=638426333554858866\u0026c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo\u0026s=gOdJxIOIH5iX085fFrSDfP4oDVfQHAbhAMCcaZlbBxW4Cw_JqHH8bSlIRah4z_zmCZzqNfWzbzWjs2dwJMgpkX0rO6LxtxBxOOaSbGxnl3uWK0QA-Ak5SW4Yk8TycJK2KIAXiRqa_JKCYetjq9XQp9l7vLyFFwTV6auuO7hjilI-7Gfdwu-ZtW3UK92Nkc4DFdOF4foQUfslGImHSpyEYmcWTCQAIIqtiBARy0cRapnjH-B5SCDDpDY7ffH5De26FZJpZxz9-FLgsGWDxBg1148OUV-ONTtPoN4x_jB8E8a54L54AeuNwRCXTS6R6Ep8LVozAHIKXLWbC7QVtCJ2YA\u0026h=XvkPJ15qxzvhKoafv2huXoYL4-5Po8CAhMFkIsiropo+3": {
"Request": {
"Method": "GET",
- "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774239?api-version=2023-01-01",
+ "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000019269460?api-version=2023-01-01\u0026t=638426333554858866\u0026c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo\u0026s=gOdJxIOIH5iX085fFrSDfP4oDVfQHAbhAMCcaZlbBxW4Cw_JqHH8bSlIRah4z_zmCZzqNfWzbzWjs2dwJMgpkX0rO6LxtxBxOOaSbGxnl3uWK0QA-Ak5SW4Yk8TycJK2KIAXiRqa_JKCYetjq9XQp9l7vLyFFwTV6auuO7hjilI-7Gfdwu-ZtW3UK92Nkc4DFdOF4foQUfslGImHSpyEYmcWTCQAIIqtiBARy0cRapnjH-B5SCDDpDY7ffH5De26FZJpZxz9-FLgsGWDxBg1148OUV-ONTtPoN4x_jB8E8a54L54AeuNwRCXTS6R6Ep8LVozAHIKXLWbC7QVtCJ2YA\u0026h=XvkPJ15qxzvhKoafv2huXoYL4-5Po8CAhMFkIsiropo",
"Content": null,
"isContentBase64": false,
"Headers": {
"Authorization": [ "[Filtered]" ],
- "x-ms-unique-id": [ "19" ],
- "x-ms-client-request-id": [ "4e20e3f9-25e9-4ede-bc65-181a0db43222" ],
- "CommandName": [ "Az.ActionGroup.internal\\Test-AzActionGroup" ],
- "FullCommandName": [ "Test-AzActionGroup_CreateExpanded" ],
- "ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ]
- },
- "ContentHeaders": {
- }
- },
- "Response": {
- "StatusCode": 202,
- "Headers": {
- "Cache-Control": [ "no-cache" ],
- "Pragma": [ "no-cache" ],
- "X-ActivityId": [ "4e20e3f9-25e9-4ede-bc65-181a0db43222" ],
- "Access-Control-Expose-Headers": [ "x-activityid" ],
- "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
- "X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
- "api-supported-versions": [ "2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-reads": [ "11997" ],
- "x-ms-request-id": [ "c7afd1df-ad02-41e3-98f4-ce448fe2fe2a" ],
- "x-ms-correlation-request-id": [ "c7afd1df-ad02-41e3-98f4-ce448fe2fe2a" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054023Z:c7afd1df-ad02-41e3-98f4-ce448fe2fe2a" ],
- "X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:40:22 GMT" ]
- },
- "ContentHeaders": {
- "Content-Length": [ "564" ],
- "Content-Type": [ "application/json; charset=utf-8" ],
- "Expires": [ "-1" ]
- },
- "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"InProgress\",\"completedTime\":\"0001-01-01T00:00:00+00:00\",\"createdTime\":\"2023-11-08T05:38:50.5790286+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"InProgress\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:39:00.7436042+00:00\",\"Message\":null},{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver2\",\"Status\":\"InProgress\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:39:00.7436042+00:00\",\"Message\":null}]}",
- "isContentBase64": false
- }
- },
- "Test-AzActionGroup+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774239?api-version=2023-01-01+5": {
- "Request": {
- "Method": "GET",
- "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774239?api-version=2023-01-01",
- "Content": null,
- "isContentBase64": false,
- "Headers": {
- "Authorization": [ "[Filtered]" ],
- "x-ms-unique-id": [ "20" ],
- "x-ms-client-request-id": [ "4e20e3f9-25e9-4ede-bc65-181a0db43222" ],
+ "x-ms-unique-id": [ "21" ],
+ "x-ms-client-request-id": [ "51129958-f62a-4aa7-85bc-2190bcbefba8" ],
"CommandName": [ "Az.ActionGroup.internal\\Test-AzActionGroup" ],
"FullCommandName": [ "Test-AzActionGroup_CreateExpanded" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ]
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ]
},
"ContentHeaders": {
}
@@ -201,26 +111,27 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "4e20e3f9-25e9-4ede-bc65-181a0db43222" ],
+ "X-ActivityId": [ "51129958-f62a-4aa7-85bc-2190bcbefba8" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
"X-ServedBy": [ "SN1AZNS000001" ],
"api-supported-versions": [ "2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-reads": [ "11996" ],
- "x-ms-request-id": [ "34959468-ab08-4b95-af03-51b3c2cc6e16" ],
- "x-ms-correlation-request-id": [ "34959468-ab08-4b95-af03-51b3c2cc6e16" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054053Z:34959468-ab08-4b95-af03-51b3c2cc6e16" ],
+ "x-ms-ratelimit-remaining-subscription-reads": [ "11999" ],
+ "x-ms-request-id": [ "7715390e-e76f-4699-ad26-54161967330b" ],
+ "x-ms-correlation-request-id": [ "7715390e-e76f-4699-ad26-54161967330b" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T085019Z:7715390e-e76f-4699-ad26-54161967330b" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:40:53 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 0A5BA2CA9A184F0BA7119937B5C6DBC9 Ref B: MAA201060514051 Ref C: 2024-02-04T08:50:18Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:50:19 GMT" ]
},
"ContentHeaders": {
- "Content-Length": [ "566" ],
+ "Content-Length": [ "560" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
- "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"Complete\",\"completedTime\":\"2023-11-08T05:40:36.83421+00:00\",\"createdTime\":\"2023-11-08T05:38:50.5790286+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver2\",\"Status\":\"Succeeded\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:39:00.7436042+00:00\",\"Message\":null},{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"Succeeded\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:39:00.7436042+00:00\",\"Message\":null}]}",
+ "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextIdType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"Complete\",\"completedTime\":\"2024-02-04T08:50:16.0240968+00:00\",\"createdTime\":\"2024-02-04T08:49:15.3189122+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"Succeeded\",\"SubState\":null,\"SendTime\":\"2024-02-04T08:49:16.0622321+00:00\",\"Message\":null},{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver2\",\"Status\":\"Succeeded\",\"SubState\":null,\"SendTime\":\"2024-02-04T08:49:16.0622321+00:00\",\"Message\":null}]}",
"isContentBase64": false
}
},
@@ -231,12 +142,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "21" ],
- "x-ms-client-request-id": [ "9b1c59e9-2541-4954-bf4b-2e93dab01a4e" ],
+ "x-ms-unique-id": [ "22" ],
+ "x-ms-client-request-id": [ "288f0748-39c6-4dcb-915b-db87b9fefea8" ],
"CommandName": [ "Get-AzActionGroup" ],
"FullCommandName": [ "Get-AzActionGroup_Get" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -247,19 +158,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "9b1c59e9-2541-4954-bf4b-2e93dab01a4e" ],
+ "X-ActivityId": [ "288f0748-39c6-4dcb-915b-db87b9fefea8" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN1AZNS00000D" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "243" ],
- "x-ms-request-id": [ "ea9f9846-ae49-485d-be44-7737a31e21f2" ],
- "x-ms-correlation-request-id": [ "ea9f9846-ae49-485d-be44-7737a31e21f2" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054054Z:ea9f9846-ae49-485d-be44-7737a31e21f2" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "249" ],
+ "x-ms-request-id": [ "ef1862f9-417a-40cf-88af-9e854ace2f25" ],
+ "x-ms-correlation-request-id": [ "ef1862f9-417a-40cf-88af-9e854ace2f25" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T085022Z:ef1862f9-417a-40cf-88af-9e854ace2f25" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:40:54 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 676C9A83E54F4EA58B467E8DA25613F6 Ref B: MAA201060514051 Ref C: 2024-02-04T08:50:19Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:50:21 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "777" ],
@@ -288,20 +200,21 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "Location": [ "https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774687?api-version=2023-01-01" ],
- "X-ActivityId": [ "1bcdf092-2176-4f42-b624-ec4a1d28c8b0" ],
+ "Location": [ "https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/21000019998691?api-version=2023-01-01\u0026t=638426334248264836\u0026c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo\u0026s=goy9eerBTjMHvcur-bMcqcVxjhyySLlXmGUc8C2rnfQi5tbqPlv322ae84APru-G_0zvBg172f3IH0x7nSagj2Sbm4F-i0nRHfspqX7tARtzoUUqKutkR8b_-Ys2LtvCN9CWbvRJCvbeZLNXHf2wDh2XqHqIg2r-tGIdZytx5YSVWOD02kbeckmHGpqrcDVw8r31W5NMwZ5qJmOnuhMQgU8t5_-BHwT9y4Mur8ahvtuRjXx7a905SDywJX3mhBP1oTfro3zdDowPt_DdVXRN6oYGavsLDv9H2qssmXlZ5zjMs1cxwUes5M3Tv6mSx5sK40_b_h6dIBmKNmLzSwTERA\u0026h=HrB4FR6LZIdiRYxPVvvX9AKYSr3xq_xtGUuvBN0XaCg" ],
+ "X-ActivityId": [ "32792fb6-f478-47fe-91de-de8a655be3ee" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN1AZNS000009" ],
"api-supported-versions": [ "2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-writes": [ "1196" ],
- "x-ms-request-id": [ "9b8e99ae-d9bb-483e-8cb5-f09070e0eb44" ],
- "x-ms-correlation-request-id": [ "9b8e99ae-d9bb-483e-8cb5-f09070e0eb44" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054055Z:9b8e99ae-d9bb-483e-8cb5-f09070e0eb44" ],
+ "x-ms-ratelimit-remaining-subscription-writes": [ "1199" ],
+ "x-ms-request-id": [ "727ed30b-da04-4cd5-902f-4e6fb5d35700" ],
+ "x-ms-correlation-request-id": [ "727ed30b-da04-4cd5-902f-4e6fb5d35700" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T085024Z:727ed30b-da04-4cd5-902f-4e6fb5d35700" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:40:55 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: C0508FF404594F528B37528499D5733E Ref B: MAA201060514051 Ref C: 2024-02-04T08:50:23Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:50:24 GMT" ]
},
"ContentHeaders": {
"Expires": [ "-1" ],
@@ -311,66 +224,20 @@
"isContentBase64": false
}
},
- "Test-AzActionGroup+[NoContext]+CreateViaIdentityExpanded+$GET+https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774687?api-version=2023-01-01+3": {
- "Request": {
- "Method": "GET",
- "RequestUri": "https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774687?api-version=2023-01-01",
- "Content": null,
- "isContentBase64": false,
- "Headers": {
- "Authorization": [ "[Filtered]" ],
- "x-ms-unique-id": [ "23" ],
- "x-ms-client-request-id": [ "1bcdf092-2176-4f42-b624-ec4a1d28c8b0" ],
- "CommandName": [ "Az.ActionGroup.internal\\Test-AzActionGroup" ],
- "FullCommandName": [ "Test-AzActionGroup_CreateViaIdentityExpanded" ],
- "ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ]
- },
- "ContentHeaders": {
- }
- },
- "Response": {
- "StatusCode": 202,
- "Headers": {
- "Cache-Control": [ "no-cache" ],
- "Pragma": [ "no-cache" ],
- "X-ActivityId": [ "1bcdf092-2176-4f42-b624-ec4a1d28c8b0" ],
- "Access-Control-Expose-Headers": [ "x-activityid" ],
- "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
- "X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
- "api-supported-versions": [ "2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-reads": [ "11995" ],
- "x-ms-request-id": [ "5e389568-3cd0-4eb2-9bab-4398de461ab5" ],
- "x-ms-correlation-request-id": [ "5e389568-3cd0-4eb2-9bab-4398de461ab5" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054126Z:5e389568-3cd0-4eb2-9bab-4398de461ab5" ],
- "X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:41:25 GMT" ]
- },
- "ContentHeaders": {
- "Content-Length": [ "558" ],
- "Content-Type": [ "application/json; charset=utf-8" ],
- "Expires": [ "-1" ]
- },
- "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"InProgress\",\"completedTime\":\"0001-01-01T00:00:00+00:00\",\"createdTime\":\"2023-11-08T05:40:54.9901662+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"InProgress\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:41:00.8749313+00:00\",\"Message\":null},{\"MechanismType\":\"Sms\",\"Name\":\"smsreceiver\",\"Status\":\"Succeeded\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:40:57.1860104+00:00\",\"Message\":null}]}",
- "isContentBase64": false
- }
- },
- "Test-AzActionGroup+[NoContext]+CreateViaIdentityExpanded+$GET+https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774687?api-version=2023-01-01+4": {
+ "Test-AzActionGroup+[NoContext]+CreateViaIdentityExpanded+$GET+https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/21000019998691?api-version=2023-01-01\u0026t=638426334248264836\u0026c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo\u0026s=goy9eerBTjMHvcur-bMcqcVxjhyySLlXmGUc8C2rnfQi5tbqPlv322ae84APru-G_0zvBg172f3IH0x7nSagj2Sbm4F-i0nRHfspqX7tARtzoUUqKutkR8b_-Ys2LtvCN9CWbvRJCvbeZLNXHf2wDh2XqHqIg2r-tGIdZytx5YSVWOD02kbeckmHGpqrcDVw8r31W5NMwZ5qJmOnuhMQgU8t5_-BHwT9y4Mur8ahvtuRjXx7a905SDywJX3mhBP1oTfro3zdDowPt_DdVXRN6oYGavsLDv9H2qssmXlZ5zjMs1cxwUes5M3Tv6mSx5sK40_b_h6dIBmKNmLzSwTERA\u0026h=HrB4FR6LZIdiRYxPVvvX9AKYSr3xq_xtGUuvBN0XaCg+3": {
"Request": {
"Method": "GET",
- "RequestUri": "https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774687?api-version=2023-01-01",
+ "RequestUri": "https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/21000019998691?api-version=2023-01-01\u0026t=638426334248264836\u0026c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo\u0026s=goy9eerBTjMHvcur-bMcqcVxjhyySLlXmGUc8C2rnfQi5tbqPlv322ae84APru-G_0zvBg172f3IH0x7nSagj2Sbm4F-i0nRHfspqX7tARtzoUUqKutkR8b_-Ys2LtvCN9CWbvRJCvbeZLNXHf2wDh2XqHqIg2r-tGIdZytx5YSVWOD02kbeckmHGpqrcDVw8r31W5NMwZ5qJmOnuhMQgU8t5_-BHwT9y4Mur8ahvtuRjXx7a905SDywJX3mhBP1oTfro3zdDowPt_DdVXRN6oYGavsLDv9H2qssmXlZ5zjMs1cxwUes5M3Tv6mSx5sK40_b_h6dIBmKNmLzSwTERA\u0026h=HrB4FR6LZIdiRYxPVvvX9AKYSr3xq_xtGUuvBN0XaCg",
"Content": null,
"isContentBase64": false,
"Headers": {
"Authorization": [ "[Filtered]" ],
"x-ms-unique-id": [ "24" ],
- "x-ms-client-request-id": [ "1bcdf092-2176-4f42-b624-ec4a1d28c8b0" ],
+ "x-ms-client-request-id": [ "32792fb6-f478-47fe-91de-de8a655be3ee" ],
"CommandName": [ "Az.ActionGroup.internal\\Test-AzActionGroup" ],
"FullCommandName": [ "Test-AzActionGroup_CreateViaIdentityExpanded" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ]
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ]
},
"ContentHeaders": {
}
@@ -380,89 +247,44 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "1bcdf092-2176-4f42-b624-ec4a1d28c8b0" ],
+ "X-ActivityId": [ "32792fb6-f478-47fe-91de-de8a655be3ee" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN1AZNS00000D" ],
"api-supported-versions": [ "2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-reads": [ "11994" ],
- "x-ms-request-id": [ "a907b341-4b81-4c79-b5de-473f074aaf78" ],
- "x-ms-correlation-request-id": [ "a907b341-4b81-4c79-b5de-473f074aaf78" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054156Z:a907b341-4b81-4c79-b5de-473f074aaf78" ],
+ "x-ms-ratelimit-remaining-subscription-reads": [ "11998" ],
+ "x-ms-request-id": [ "68a73c2a-c676-46f9-8b53-d12f1e933a91" ],
+ "x-ms-correlation-request-id": [ "68a73c2a-c676-46f9-8b53-d12f1e933a91" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T085058Z:68a73c2a-c676-46f9-8b53-d12f1e933a91" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:41:56 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 1DC98ACA1A534E179652B40E016F7300 Ref B: MAA201060514051 Ref C: 2024-02-04T08:50:55Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:50:57 GMT" ]
},
"ContentHeaders": {
- "Content-Length": [ "558" ],
+ "Content-Length": [ "548" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
- "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"InProgress\",\"completedTime\":\"0001-01-01T00:00:00+00:00\",\"createdTime\":\"2023-11-08T05:40:54.9901662+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"InProgress\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:41:00.8749313+00:00\",\"Message\":null},{\"MechanismType\":\"Sms\",\"Name\":\"smsreceiver\",\"Status\":\"Succeeded\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:40:57.1860104+00:00\",\"Message\":null}]}",
+ "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextIdType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"InProgress\",\"completedTime\":\"0001-01-01T00:00:00+00:00\",\"createdTime\":\"2024-02-04T08:50:24.664503+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"Succeeded\",\"SubState\":null,\"SendTime\":\"2024-02-04T08:50:25.0377427+00:00\",\"Message\":null},{\"MechanismType\":\"Sms\",\"Name\":\"smsreceiver\",\"Status\":\"Succeeded\",\"SubState\":null,\"SendTime\":\"2024-02-04T08:50:24.9752471+00:00\",\"Message\":null}]}",
"isContentBase64": false
}
},
- "Test-AzActionGroup+[NoContext]+CreateViaIdentityExpanded+$GET+https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774687?api-version=2023-01-01+5": {
+ "Test-AzActionGroup+[NoContext]+CreateViaIdentityExpanded+$GET+https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/21000019998691?api-version=2023-01-01\u0026t=638426334248264836\u0026c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo\u0026s=goy9eerBTjMHvcur-bMcqcVxjhyySLlXmGUc8C2rnfQi5tbqPlv322ae84APru-G_0zvBg172f3IH0x7nSagj2Sbm4F-i0nRHfspqX7tARtzoUUqKutkR8b_-Ys2LtvCN9CWbvRJCvbeZLNXHf2wDh2XqHqIg2r-tGIdZytx5YSVWOD02kbeckmHGpqrcDVw8r31W5NMwZ5qJmOnuhMQgU8t5_-BHwT9y4Mur8ahvtuRjXx7a905SDywJX3mhBP1oTfro3zdDowPt_DdVXRN6oYGavsLDv9H2qssmXlZ5zjMs1cxwUes5M3Tv6mSx5sK40_b_h6dIBmKNmLzSwTERA\u0026h=HrB4FR6LZIdiRYxPVvvX9AKYSr3xq_xtGUuvBN0XaCg+4": {
"Request": {
"Method": "GET",
- "RequestUri": "https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774687?api-version=2023-01-01",
+ "RequestUri": "https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/21000019998691?api-version=2023-01-01\u0026t=638426334248264836\u0026c=MIIHHjCCBgagAwIBAgITOgI9LlF5jGEEQe1CmgAEAj0uUTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjMxMTAxMjE0OTQ5WhcNMjQxMDI2MjE0OTQ5WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKt_zl2yRFDxIUmqoEA-B7WoRkSqscgwk6CGqDbwEVJS3oTI4Gk-ukQ6El3GQJVthiuwZGw4jwvTDyVWC8mQH2Zni6X1ocTXrNNa6VFJnvzeEn-HpmPATuII8AWtdtUnBvGZGAwgspvH8iZZCiHDowHCWhjVsU6_ipCsmzQeH3oRJI4AwUS_nCVA7U9WPdgIyQp6v5QPzcYCO_zIbNW4y_Cc3phfPEQvPvtSKhuijt68F5WlUY6Ps23ksosYG5VTx7z6skGG9arA5UKUzbbEO8lxzda3OFPZdG7OHe8-VMXxJjtSanZSSbdLgYBRB9m9PGr6voKtML9W5rEukE-lEUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRYUmiD-EjeFFNZByiKICN9p1JofzAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAKRwStAdrsy7tgEfmtXPZXIwgdXOYwSx2Kqzlhq8b6Ptid4V3vhJvDV0WLS7d72KIMUwZiBnfPHhMmsdkLOSpNSZYC23g3QJSBWvoS86Rpkeru5bEyQmv1gucF_MyaFaUXUd4b7xnvCkv-BBNO8m1lvFAowB2odz9esggf82yeOVBx0yEK_NNOK4l36XvRjvIqemSLZOSi1wow_wn_ovhAEPpSSN7UTahPtz7J12vhP1LuZ4Rvn_hNx48ncw445nMBnMVmcuuakaKDC6_sAcs5lg9jq2yHSaIHRw4xcoS5XwvIykGPMUyAD-dXWFih_XFOKh7ea50hObFhghf3Dtvlo\u0026s=goy9eerBTjMHvcur-bMcqcVxjhyySLlXmGUc8C2rnfQi5tbqPlv322ae84APru-G_0zvBg172f3IH0x7nSagj2Sbm4F-i0nRHfspqX7tARtzoUUqKutkR8b_-Ys2LtvCN9CWbvRJCvbeZLNXHf2wDh2XqHqIg2r-tGIdZytx5YSVWOD02kbeckmHGpqrcDVw8r31W5NMwZ5qJmOnuhMQgU8t5_-BHwT9y4Mur8ahvtuRjXx7a905SDywJX3mhBP1oTfro3zdDowPt_DdVXRN6oYGavsLDv9H2qssmXlZ5zjMs1cxwUes5M3Tv6mSx5sK40_b_h6dIBmKNmLzSwTERA\u0026h=HrB4FR6LZIdiRYxPVvvX9AKYSr3xq_xtGUuvBN0XaCg",
"Content": null,
"isContentBase64": false,
"Headers": {
"Authorization": [ "[Filtered]" ],
"x-ms-unique-id": [ "25" ],
- "x-ms-client-request-id": [ "1bcdf092-2176-4f42-b624-ec4a1d28c8b0" ],
+ "x-ms-client-request-id": [ "32792fb6-f478-47fe-91de-de8a655be3ee" ],
"CommandName": [ "Az.ActionGroup.internal\\Test-AzActionGroup" ],
"FullCommandName": [ "Test-AzActionGroup_CreateViaIdentityExpanded" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ]
- },
- "ContentHeaders": {
- }
- },
- "Response": {
- "StatusCode": 202,
- "Headers": {
- "Cache-Control": [ "no-cache" ],
- "Pragma": [ "no-cache" ],
- "X-ActivityId": [ "1bcdf092-2176-4f42-b624-ec4a1d28c8b0" ],
- "Access-Control-Expose-Headers": [ "x-activityid" ],
- "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
- "X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
- "api-supported-versions": [ "2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-reads": [ "11993" ],
- "x-ms-request-id": [ "6cd04047-c67e-45b5-b9d9-b05785441f9a" ],
- "x-ms-correlation-request-id": [ "6cd04047-c67e-45b5-b9d9-b05785441f9a" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054227Z:6cd04047-c67e-45b5-b9d9-b05785441f9a" ],
- "X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:42:26 GMT" ]
- },
- "ContentHeaders": {
- "Content-Length": [ "558" ],
- "Content-Type": [ "application/json; charset=utf-8" ],
- "Expires": [ "-1" ]
- },
- "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"InProgress\",\"completedTime\":\"0001-01-01T00:00:00+00:00\",\"createdTime\":\"2023-11-08T05:40:54.9901662+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"InProgress\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:41:00.8749313+00:00\",\"Message\":null},{\"MechanismType\":\"Sms\",\"Name\":\"smsreceiver\",\"Status\":\"Succeeded\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:40:57.1860104+00:00\",\"Message\":null}]}",
- "isContentBase64": false
- }
- },
- "Test-AzActionGroup+[NoContext]+CreateViaIdentityExpanded+$GET+https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774687?api-version=2023-01-01+6": {
- "Request": {
- "Method": "GET",
- "RequestUri": "https://management.azure.com/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet/notificationStatus/11000010774687?api-version=2023-01-01",
- "Content": null,
- "isContentBase64": false,
- "Headers": {
- "Authorization": [ "[Filtered]" ],
- "x-ms-unique-id": [ "26" ],
- "x-ms-client-request-id": [ "1bcdf092-2176-4f42-b624-ec4a1d28c8b0" ],
- "CommandName": [ "Az.ActionGroup.internal\\Test-AzActionGroup" ],
- "FullCommandName": [ "Test-AzActionGroup_CreateViaIdentityExpanded" ],
- "ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ]
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ]
},
"ContentHeaders": {
}
@@ -472,26 +294,27 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "1bcdf092-2176-4f42-b624-ec4a1d28c8b0" ],
+ "X-ActivityId": [ "32792fb6-f478-47fe-91de-de8a655be3ee" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN2AZNS00000A" ],
"api-supported-versions": [ "2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-reads": [ "11992" ],
- "x-ms-request-id": [ "6d87371d-5cbe-4180-8467-81f3897e4108" ],
- "x-ms-correlation-request-id": [ "6d87371d-5cbe-4180-8467-81f3897e4108" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054258Z:6d87371d-5cbe-4180-8467-81f3897e4108" ],
+ "x-ms-ratelimit-remaining-subscription-reads": [ "11999" ],
+ "x-ms-request-id": [ "f0601773-d518-4a0d-ad83-a6c03ad9f704" ],
+ "x-ms-correlation-request-id": [ "f0601773-d518-4a0d-ad83-a6c03ad9f704" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T085130Z:f0601773-d518-4a0d-ad83-a6c03ad9f704" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:42:57 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 92BF81CA2C0D48D7BA8CE5773CC0CA1E Ref B: MAA201060514051 Ref C: 2024-02-04T08:51:28Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:51:29 GMT" ]
},
"ContentHeaders": {
- "Content-Length": [ "563" ],
+ "Content-Length": [ "554" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
- "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"Complete\",\"completedTime\":\"2023-11-08T05:42:36.9173926+00:00\",\"createdTime\":\"2023-11-08T05:40:54.9901662+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"Succeeded\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:41:00.8749313+00:00\",\"Message\":null},{\"MechanismType\":\"Sms\",\"Name\":\"smsreceiver\",\"Status\":\"Succeeded\",\"SubState\":\"Default\",\"SendTime\":\"2023-11-08T05:40:57.1860104+00:00\",\"Message\":null}]}",
+ "Content": "{\"context\":{\"notificationSource\":\"Microsoft.Insights/TestNotification\",\"contextIdType\":\"Microsoft.Insights/ServiceHealth\"},\"state\":\"Complete\",\"completedTime\":\"2024-02-04T08:51:24.9618013+00:00\",\"createdTime\":\"2024-02-04T08:50:24.664503+00:00\",\"actionDetails\":[{\"MechanismType\":\"Email\",\"Name\":\"emailreceiver1\",\"Status\":\"Succeeded\",\"SubState\":null,\"SendTime\":\"2024-02-04T08:50:25.0377427+00:00\",\"Message\":null},{\"MechanismType\":\"Sms\",\"Name\":\"smsreceiver\",\"Status\":\"Succeeded\",\"SubState\":null,\"SendTime\":\"2024-02-04T08:50:24.9752471+00:00\",\"Message\":null}]}",
"isContentBase64": false
}
}
diff --git a/src/Monitor/ActionGroup.Autorest/test/Update-AzActionGroup.Recording.json b/src/Monitor/ActionGroup.Autorest/test/Update-AzActionGroup.Recording.json
index 6017914b7fd2..ae1ce1298fc3 100644
--- a/src/Monitor/ActionGroup.Autorest/test/Update-AzActionGroup.Recording.json
+++ b/src/Monitor/ActionGroup.Autorest/test/Update-AzActionGroup.Recording.json
@@ -6,12 +6,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "27" ],
- "x-ms-client-request-id": [ "9c84147c-ec84-490c-92b1-243c60f443b8" ],
+ "x-ms-unique-id": [ "26" ],
+ "x-ms-client-request-id": [ "9000d11b-7c9c-45d3-b52a-7d451fbdf9a6" ],
"CommandName": [ "Update-AzActionGroup" ],
"FullCommandName": [ "Update-AzActionGroup_UpdateExpanded" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -22,19 +22,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "9c84147c-ec84-490c-92b1-243c60f443b8" ],
+ "X-ActivityId": [ "9000d11b-7c9c-45d3-b52a-7d451fbdf9a6" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN2AZNS000009" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "242" ],
- "x-ms-request-id": [ "701acc36-c3ca-4ad4-97f2-ab0d925c92b6" ],
- "x-ms-correlation-request-id": [ "701acc36-c3ca-4ad4-97f2-ab0d925c92b6" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054259Z:701acc36-c3ca-4ad4-97f2-ab0d925c92b6" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "249" ],
+ "x-ms-request-id": [ "9e05b878-68d0-4010-aeef-7b0eabe042c0" ],
+ "x-ms-correlation-request-id": [ "9e05b878-68d0-4010-aeef-7b0eabe042c0" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T085132Z:9e05b878-68d0-4010-aeef-7b0eabe042c0" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:42:58 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 435428C0184C43299EA3B4F79BE20F2E Ref B: MAA201060514051 Ref C: 2024-02-04T08:51:30Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:51:31 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "777" ],
@@ -49,13 +50,13 @@
"Request": {
"Method": "PUT",
"RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/Microsoft.Insights/actionGroups/actiongroupGet?api-version=2023-01-01",
- "Content": "{\r\n \"location\": \"southcentralus\",\r\n \"properties\": {\r\n \"groupShortName\": \"ag1\",\r\n \"enabled\": false,\r\n \"emailReceivers\": [\r\n {\r\n \"name\": \"emailreceiver1\",\r\n \"emailAddress\": \"v-jiaji@microsoft.com\",\r\n \"useCommonAlertSchema\": false\r\n }\r\n ],\r\n \"smsReceivers\": [\r\n {\r\n \"name\": \"smsreceiver\",\r\n \"countryCode\": \"86\",\r\n \"phoneNumber\": \"18964587446\"\r\n }\r\n ],\r\n \"webhookReceivers\": [ ],\r\n \"itsmReceivers\": [ ],\r\n \"azureAppPushReceivers\": [ ],\r\n \"automationRunbookReceivers\": [ ],\r\n \"voiceReceivers\": [ ],\r\n \"logicAppReceivers\": [ ],\r\n \"azureFunctionReceivers\": [ ],\r\n \"armRoleReceivers\": [ ],\r\n \"eventHubReceivers\": [\r\n {\r\n \"name\": \"sample eventhub\",\r\n \"eventHubNameSpace\": \"Namespace1894859101\",\r\n \"eventHubName\": \"testEventHub452586681\",\r\n \"subscriptionId\": \"9e223dbe-3399-4e19-88eb-0975f02ac87f\"\r\n }\r\n ]\r\n }\r\n}",
+ "Content": "{\r\n \"location\": \"southcentralus\",\r\n \"properties\": {\r\n \"groupShortName\": \"ag1\",\r\n \"enabled\": false,\r\n \"emailReceivers\": [\r\n {\r\n \"name\": \"emailreceiver1\",\r\n \"emailAddress\": \"v-jiaji@microsoft.com\",\r\n \"useCommonAlertSchema\": false\r\n }\r\n ],\r\n \"smsReceivers\": [\r\n {\r\n \"name\": \"smsreceiver\",\r\n \"countryCode\": \"86\",\r\n \"phoneNumber\": \"18964587446\"\r\n }\r\n ],\r\n \"webhookReceivers\": [ ],\r\n \"itsmReceivers\": [ ],\r\n \"azureAppPushReceivers\": [ ],\r\n \"automationRunbookReceivers\": [ ],\r\n \"voiceReceivers\": [ ],\r\n \"logicAppReceivers\": [ ],\r\n \"azureFunctionReceivers\": [ ],\r\n \"armRoleReceivers\": [ ],\r\n \"eventHubReceivers\": [\r\n {\r\n \"name\": \"sample eventhub\",\r\n \"eventHubNameSpace\": \"Namespace20240204\",\r\n \"eventHubName\": \"testEventHub20240204\",\r\n \"subscriptionId\": \"9e223dbe-3399-4e19-88eb-0975f02ac87f\"\r\n }\r\n ]\r\n }\r\n}",
"isContentBase64": false,
"Headers": {
},
"ContentHeaders": {
"Content-Type": [ "application/json" ],
- "Content-Length": [ "953" ]
+ "Content-Length": [ "950" ]
}
},
"Response": {
@@ -63,26 +64,27 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "9c84147c-ec84-490c-92b1-243c60f443b8" ],
+ "X-ActivityId": [ "9000d11b-7c9c-45d3-b52a-7d451fbdf9a6" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN1AZNS00000C" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "21" ],
- "x-ms-request-id": [ "e2c5c78b-7bb2-4f2b-b623-e8596ef41b23" ],
- "x-ms-correlation-request-id": [ "e2c5c78b-7bb2-4f2b-b623-e8596ef41b23" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054300Z:e2c5c78b-7bb2-4f2b-b623-e8596ef41b23" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "24" ],
+ "x-ms-request-id": [ "bed0408b-06ab-4c9e-b5a4-087a30167dba" ],
+ "x-ms-correlation-request-id": [ "bed0408b-06ab-4c9e-b5a4-087a30167dba" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T085134Z:bed0408b-06ab-4c9e-b5a4-087a30167dba" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:42:59 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 6D0C43713E524D75BCFF7E8EE5B41A98 Ref B: MAA201060514051 Ref C: 2024-02-04T08:51:32Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:51:33 GMT" ]
},
"ContentHeaders": {
- "Content-Length": [ "1019" ],
+ "Content-Length": [ "1016" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
- "Content": "{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroupGet\",\"location\":\"southcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[{\"name\":\"emailreceiver1\",\"emailAddress\":\"v-jiaji@microsoft.com\",\"useCommonAlertSchema\":false,\"status\":\"Enabled\"}],\"smsReceivers\":[{\"name\":\"smsreceiver\",\"countryCode\":\"86\",\"phoneNumber\":\"18964587446\",\"status\":\"Enabled\"}],\"webhookReceivers\":[],\"eventHubReceivers\":[{\"name\":\"sample eventhub\",\"subscriptionId\":\"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\"eventHubNameSpace\":\"Namespace1894859101\",\"eventHubName\":\"testEventHub452586681\",\"useCommonAlertSchema\":false,\"tenantId\":\"72f988bf-86f1-41af-91ab-2d7cd011db47\"}],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}}",
+ "Content": "{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroupGet\",\"location\":\"southcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[{\"name\":\"emailreceiver1\",\"emailAddress\":\"v-jiaji@microsoft.com\",\"useCommonAlertSchema\":false,\"status\":\"Enabled\"}],\"smsReceivers\":[{\"name\":\"smsreceiver\",\"countryCode\":\"86\",\"phoneNumber\":\"18964587446\",\"status\":\"Enabled\"}],\"webhookReceivers\":[],\"eventHubReceivers\":[{\"name\":\"sample eventhub\",\"subscriptionId\":\"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\"eventHubNameSpace\":\"Namespace20240204\",\"eventHubName\":\"testEventHub20240204\",\"useCommonAlertSchema\":false,\"tenantId\":\"72f988bf-86f1-41af-91ab-2d7cd011db47\"}],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}}",
"isContentBase64": false
}
},
@@ -93,12 +95,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "29" ],
- "x-ms-client-request-id": [ "47c14800-3168-4bc2-a4f2-b1b8db8116d4" ],
+ "x-ms-unique-id": [ "28" ],
+ "x-ms-client-request-id": [ "a1caa495-4b06-4fdd-917d-597b0ee9e650" ],
"CommandName": [ "Get-AzActionGroup" ],
"FullCommandName": [ "Get-AzActionGroup_Get" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -109,26 +111,27 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "47c14800-3168-4bc2-a4f2-b1b8db8116d4" ],
+ "X-ActivityId": [ "a1caa495-4b06-4fdd-917d-597b0ee9e650" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN1AZNS000007" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "241" ],
- "x-ms-request-id": [ "c8051b63-d0f8-4b9d-a586-93782f69be43" ],
- "x-ms-correlation-request-id": [ "c8051b63-d0f8-4b9d-a586-93782f69be43" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054301Z:c8051b63-d0f8-4b9d-a586-93782f69be43" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "249" ],
+ "x-ms-request-id": [ "98825080-1f79-47c0-bf95-4d09b1125067" ],
+ "x-ms-correlation-request-id": [ "98825080-1f79-47c0-bf95-4d09b1125067" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T085136Z:98825080-1f79-47c0-bf95-4d09b1125067" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:43:00 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 82257616221746F69AFC067649845AA7 Ref B: MAA201060514051 Ref C: 2024-02-04T08:51:34Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:51:35 GMT" ]
},
"ContentHeaders": {
- "Content-Length": [ "1019" ],
+ "Content-Length": [ "1016" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
- "Content": "{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroupGet\",\"location\":\"southcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[{\"name\":\"emailreceiver1\",\"emailAddress\":\"v-jiaji@microsoft.com\",\"useCommonAlertSchema\":false,\"status\":\"Enabled\"}],\"smsReceivers\":[{\"name\":\"smsreceiver\",\"countryCode\":\"86\",\"phoneNumber\":\"18964587446\",\"status\":\"Enabled\"}],\"webhookReceivers\":[],\"eventHubReceivers\":[{\"name\":\"sample eventhub\",\"subscriptionId\":\"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\"eventHubNameSpace\":\"Namespace1894859101\",\"eventHubName\":\"testEventHub452586681\",\"useCommonAlertSchema\":false,\"tenantId\":\"72f988bf-86f1-41af-91ab-2d7cd011db47\"}],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}}",
+ "Content": "{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroupGet\",\"location\":\"southcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[{\"name\":\"emailreceiver1\",\"emailAddress\":\"v-jiaji@microsoft.com\",\"useCommonAlertSchema\":false,\"status\":\"Enabled\"}],\"smsReceivers\":[{\"name\":\"smsreceiver\",\"countryCode\":\"86\",\"phoneNumber\":\"18964587446\",\"status\":\"Enabled\"}],\"webhookReceivers\":[],\"eventHubReceivers\":[{\"name\":\"sample eventhub\",\"subscriptionId\":\"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\"eventHubNameSpace\":\"Namespace20240204\",\"eventHubName\":\"testEventHub20240204\",\"useCommonAlertSchema\":false,\"tenantId\":\"72f988bf-86f1-41af-91ab-2d7cd011db47\"}],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}}",
"isContentBase64": false
}
},
@@ -139,12 +142,12 @@
"Content": null,
"isContentBase64": false,
"Headers": {
- "x-ms-unique-id": [ "30" ],
- "x-ms-client-request-id": [ "816f7f0f-1555-4417-9091-72b9e932d908" ],
+ "x-ms-unique-id": [ "29" ],
+ "x-ms-client-request-id": [ "3b0a944a-4bcf-47d8-ab41-cbacbdd1f74c" ],
"CommandName": [ "Update-AzActionGroup" ],
"FullCommandName": [ "Update-AzActionGroup_UpdateViaIdentityExpanded" ],
"ParameterSetName": [ "__AllParameterSets" ],
- "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.9", "Az.ActionGroup/0.1.0" ],
+ "User-Agent": [ "AzurePowershell/v10.1.0", "PSVersion/v7.3.11", "Az.ActionGroup/0.1.0" ],
"Authorization": [ "[Filtered]" ]
},
"ContentHeaders": {
@@ -155,26 +158,27 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "816f7f0f-1555-4417-9091-72b9e932d908" ],
+ "X-ActivityId": [ "3b0a944a-4bcf-47d8-ab41-cbacbdd1f74c" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN2AZNS000003" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "240" ],
- "x-ms-request-id": [ "96fdb999-30bb-47f3-b962-0cec0000b350" ],
- "x-ms-correlation-request-id": [ "96fdb999-30bb-47f3-b962-0cec0000b350" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054302Z:96fdb999-30bb-47f3-b962-0cec0000b350" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "249" ],
+ "x-ms-request-id": [ "955af42a-58e2-439a-8f86-fecf8070f58c" ],
+ "x-ms-correlation-request-id": [ "955af42a-58e2-439a-8f86-fecf8070f58c" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T085137Z:955af42a-58e2-439a-8f86-fecf8070f58c" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:43:01 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: 318235AB23D246C6B5C9B72C0E065443 Ref B: MAA201060514051 Ref C: 2024-02-04T08:51:36Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:51:37 GMT" ]
},
"ContentHeaders": {
- "Content-Length": [ "1019" ],
+ "Content-Length": [ "1016" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
- "Content": "{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroupGet\",\"location\":\"southcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[{\"name\":\"emailreceiver1\",\"emailAddress\":\"v-jiaji@microsoft.com\",\"useCommonAlertSchema\":false,\"status\":\"Enabled\"}],\"smsReceivers\":[{\"name\":\"smsreceiver\",\"countryCode\":\"86\",\"phoneNumber\":\"18964587446\",\"status\":\"Enabled\"}],\"webhookReceivers\":[],\"eventHubReceivers\":[{\"name\":\"sample eventhub\",\"subscriptionId\":\"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\"eventHubNameSpace\":\"Namespace1894859101\",\"eventHubName\":\"testEventHub452586681\",\"useCommonAlertSchema\":false,\"tenantId\":\"72f988bf-86f1-41af-91ab-2d7cd011db47\"}],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}}",
+ "Content": "{\"id\":\"/subscriptions/9E223DBE-3399-4E19-88EB-0975F02AC87F/resourceGroups/Monitor-ActionGroup/providers/microsoft.insights/actionGroups/actiongroupGet\",\"type\":\"Microsoft.Insights/ActionGroups\",\"name\":\"actiongroupGet\",\"location\":\"southcentralus\",\"kind\":null,\"tags\":null,\"properties\":{\"groupShortName\":\"ag1\",\"enabled\":false,\"emailReceivers\":[{\"name\":\"emailreceiver1\",\"emailAddress\":\"v-jiaji@microsoft.com\",\"useCommonAlertSchema\":false,\"status\":\"Enabled\"}],\"smsReceivers\":[{\"name\":\"smsreceiver\",\"countryCode\":\"86\",\"phoneNumber\":\"18964587446\",\"status\":\"Enabled\"}],\"webhookReceivers\":[],\"eventHubReceivers\":[{\"name\":\"sample eventhub\",\"subscriptionId\":\"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\"eventHubNameSpace\":\"Namespace20240204\",\"eventHubName\":\"testEventHub20240204\",\"useCommonAlertSchema\":false,\"tenantId\":\"72f988bf-86f1-41af-91ab-2d7cd011db47\"}],\"itsmReceivers\":[],\"azureAppPushReceivers\":[],\"automationRunbookReceivers\":[],\"voiceReceivers\":[],\"logicAppReceivers\":[],\"azureFunctionReceivers\":[],\"armRoleReceivers\":[]}}",
"isContentBase64": false
}
},
@@ -196,19 +200,20 @@
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
- "X-ActivityId": [ "816f7f0f-1555-4417-9091-72b9e932d908" ],
+ "X-ActivityId": [ "3b0a944a-4bcf-47d8-ab41-cbacbdd1f74c" ],
"Access-Control-Expose-Headers": [ "x-activityid" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"X-Frame-Options": [ "SAMEORIGIN" ],
- "X-ServedBy": [ "SN1AZNS000001" ],
+ "X-ServedBy": [ "SN1AZNS000003" ],
"api-supported-versions": [ "2016-09-01-preview, 2017-03-01-preview, 2017-04-01, 2018-03-01, 2018-09-01, 2019-03-01, 2019-06-01, 2021-09-01, 2022-04-01, 2022-06-01, 2023-01-01, 2023-03-01-preview, 2023-05-01-preview, 2023-05-01, 2023-08-01-preview, 2023-09-01-preview" ],
- "Server": [ "Microsoft-HTTPAPI/2.0" ],
- "x-ms-ratelimit-remaining-subscription-resource-requests": [ "20" ],
- "x-ms-request-id": [ "f9b75b73-fbb1-4c13-8c22-3d3021e0d778" ],
- "x-ms-correlation-request-id": [ "f9b75b73-fbb1-4c13-8c22-3d3021e0d778" ],
- "x-ms-routing-request-id": [ "SOUTHEASTASIA:20231108T054302Z:f9b75b73-fbb1-4c13-8c22-3d3021e0d778" ],
+ "x-ms-ratelimit-remaining-subscription-resource-requests": [ "24" ],
+ "x-ms-request-id": [ "4720834c-1c85-4c74-8b62-b7b9ed262f38" ],
+ "x-ms-correlation-request-id": [ "4720834c-1c85-4c74-8b62-b7b9ed262f38" ],
+ "x-ms-routing-request-id": [ "SOUTHEASTASIA:20240204T085139Z:4720834c-1c85-4c74-8b62-b7b9ed262f38" ],
"X-Content-Type-Options": [ "nosniff" ],
- "Date": [ "Wed, 08 Nov 2023 05:43:01 GMT" ]
+ "X-Cache": [ "CONFIG_NOCACHE" ],
+ "X-MSEdge-Ref": [ "Ref A: EFD46B7A6BBB4E398BC31F6F8BAE121E Ref B: MAA201060514051 Ref C: 2024-02-04T08:51:38Z" ],
+ "Date": [ "Sun, 04 Feb 2024 08:51:39 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "777" ],
diff --git a/src/Monitor/ActionGroup.Autorest/test/env.json b/src/Monitor/ActionGroup.Autorest/test/env.json
index c71a54cd93d7..fa82fa27ec21 100644
--- a/src/Monitor/ActionGroup.Autorest/test/env.json
+++ b/src/Monitor/ActionGroup.Autorest/test/env.json
@@ -1,17 +1,17 @@
{
+ "SubscriptionId": "9e223dbe-3399-4e19-88eb-0975f02ac87f",
+ "userphone": "18964587446",
+ "region": "northcentralus",
"Tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47",
+ "smsreceiver": "smsreceiver",
+ "emailreceiver1": "emailreceiver1",
"phonecountry": "86",
+ "actiongroup1": "actiongroup1",
+ "emailreceiver2": "emailreceiver2",
"actiongroup3": "actiongroup3",
+ "useremail": "v-jiaji@microsoft.com",
+ "EventHubNamespaceName": "Namespace20240204",
"resourceGroup": "Monitor-ActionGroup",
- "emailreceiver1": "emailreceiver1",
- "emailreceiver2": "emailreceiver2",
- "smsreceiver": "smsreceiver",
"actiongroupname": "actiongroupGet",
- "eventHubName": "testEventHub452586681",
- "userphone": "18964587446",
- "region": "northcentralus",
- "actiongroup1": "actiongroup1",
- "SubscriptionId": "9e223dbe-3399-4e19-88eb-0975f02ac87f",
- "useremail": "v-jiaji@microsoft.com",
- "EventHubNamespaceName": "Namespace1894859101"
+ "eventHubName": "testEventHub20240204"
}
diff --git a/src/Monitor/ActionGroup.Autorest/test/utils.ps1 b/src/Monitor/ActionGroup.Autorest/test/utils.ps1
index 828b4bdb99cd..f3a502080339 100644
--- a/src/Monitor/ActionGroup.Autorest/test/utils.ps1
+++ b/src/Monitor/ActionGroup.Autorest/test/utils.ps1
@@ -66,9 +66,9 @@ function setupEnv() {
$env.actiongroup1 = 'actiongroup1'
$env.actiongroup3 = 'actiongroup3'
- $env.EventHubNamespaceName = "Namespace$(Get-Random)"
- New-AzEventHubNamespace -ResourceGroupName $env.resourceGroup -NamespaceName $env.EventHubNamespaceName -Location $env.region
- $env.eventHubName = "testEventHub$(Get-Random)"
+ $env.EventHubNamespaceName = "Namespace20240204"
+ New-AzEventHubNamespace -ResourceGroupName $env.resourceGroup -Name $env.EventHubNamespaceName -Location $env.region
+ $env.eventHubName = "testEventHub20240204"
New-AzEventHub -ResourceGroupName $env.resourceGroup -NamespaceName $env.EventHubNamespaceName -EventHubName $env.eventHubName
Write-Host "create test event hub namespace" $env.EventHubNamespaceName
Write-Host "create test event hub" $env.eventHubName
@@ -76,7 +76,7 @@ function setupEnv() {
Write-Host "Start to create test action group" $env.actiongroupname
$email1 = New-AzActionGroupEmailReceiverObject -EmailAddress $env.useremail -Name $env.emailreceiver1
$sms1 = New-AzActionGroupSmsReceiverObject -CountryCode $env.phonecountry -Name $env.smsreceiver -PhoneNumber $env.userphone
- $ag = New-AzActionGroup -Name $env.actiongroupname -ResourceGroupName $env.resourceGroup -Location southcentralus -EmailReceiver $email1 -SmsReceiver $sms1 -ShortName ag1
+ New-AzActionGroup -Name $env.actiongroupname -ResourceGroupName $env.resourceGroup -Location southcentralus -EmailReceiver $email1 -SmsReceiver $sms1 -ShortName ag1
# For any resources you created for test, you should add it to $env here.
$envFile = 'env.json'
@@ -88,5 +88,6 @@ function setupEnv() {
function cleanupEnv() {
# Clean resources you create for testing
Remove-AzActionGroup -Name 'actiongroupGet' -ResourceGroupName 'Monitor-ActionGroup'
+ Remove-AzEventHubNamespace -ResourceGroupName 'Monitor-ActionGroup' -Name "Namespace20240204"
}
diff --git a/src/Monitor/ActivityLogAlert.Autorest/README.md b/src/Monitor/ActivityLogAlert.Autorest/README.md
index 9d1eebe5e561..fd8e0047dc65 100644
--- a/src/Monitor/ActivityLogAlert.Autorest/README.md
+++ b/src/Monitor/ActivityLogAlert.Autorest/README.md
@@ -29,12 +29,13 @@ For information on how to develop for `Az.ActivityLogAlert`, see [how-to.md](how
### AutoRest Configuration
> see https://aka.ms/autorest
``` yaml
+commit: e94b0da0c7f80e2986af90c1dd7e9c8f4c336c61
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
# You need to specify your swagger files here.
- - https://github.com/Azure/azure-rest-api-specs/blob/e94b0da0c7f80e2986af90c1dd7e9c8f4c336c61/specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/activityLogAlerts_API.json
+ - $(repo)/specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/activityLogAlerts_API.json
root-module-name: $(prefix).Monitor
title: ActivityLogAlert
@@ -48,6 +49,10 @@ nested-object-to-string: true
# uncomment following line to support viaIdentity for these post APIs
# identity-correction-for-post: true
+# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
+use-extension:
+ "@autorest/powershell": "3.x"
+
directive:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
diff --git a/src/Monitor/Autoscale.Autorest/README.md b/src/Monitor/Autoscale.Autorest/README.md
index 66456be4297c..bcd43fed9b5d 100644
--- a/src/Monitor/Autoscale.Autorest/README.md
+++ b/src/Monitor/Autoscale.Autorest/README.md
@@ -29,12 +29,13 @@ For information on how to develop for `Az.Autoscale`, see [how-to.md](how-to.md)
### AutoRest Configuration
> see https://aka.ms/autorest
``` yaml
+commit: 9ae616c4a5447e9cae43752b68f089bff2e46398
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
# You need to specify your swagger files here.
- - https://github.com/Azure/azure-rest-api-specs/blob/9ae616c4a5447e9cae43752b68f089bff2e46398/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/autoscale_API.json
+ - $(repo)/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/autoscale_API.json
root-module-name: $(prefix).Monitor
title: Autoscale
@@ -47,6 +48,10 @@ nested-object-to-string: true
# uncomment following line to support viaIdentity for these post APIs
# identity-correction-for-post: true
+# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
+use-extension:
+ "@autorest/powershell": "3.x"
+
directive:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
diff --git a/src/Monitor/Autoscale.Autorest/test/utils.ps1 b/src/Monitor/Autoscale.Autorest/test/utils.ps1
index 37ba75ec8b2c..c3c5dc318fb4 100644
--- a/src/Monitor/Autoscale.Autorest/test/utils.ps1
+++ b/src/Monitor/Autoscale.Autorest/test/utils.ps1
@@ -5,6 +5,31 @@ function RandomString([bool]$allChars, [int32]$len) {
return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_})
}
}
+function Start-TestSleep {
+ [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')]
+ param(
+ [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')]
+ [ValidateRange(0.0, 2147483.0)]
+ [double] $Seconds,
+
+ [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')]
+ [ValidateRange('NonNegative')]
+ [Alias('ms')]
+ [int] $Milliseconds
+ )
+
+ if ($TestMode -ne 'playback') {
+ switch ($PSCmdlet.ParameterSetName) {
+ 'SleepBySeconds' {
+ Start-Sleep -Seconds $Seconds
+ }
+ 'SleepByMilliseconds' {
+ Start-Sleep -Milliseconds $Milliseconds
+ }
+ }
+ }
+}
+
$env = @{}
if ($UsePreviousConfigForRecord) {
$previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json
diff --git a/src/Monitor/DataCollectionRule.Autorest/README.md b/src/Monitor/DataCollectionRule.Autorest/README.md
index beab9b3f86b4..f1d2f5f4686a 100644
--- a/src/Monitor/DataCollectionRule.Autorest/README.md
+++ b/src/Monitor/DataCollectionRule.Autorest/README.md
@@ -34,7 +34,7 @@ For information on how to develop for `Az.DataCollectionRule`, see [how-to.md](h
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
-branch: 4f4044394791773e6e7e82a9bd90d3935caaca1b
+commit: 4f4044394791773e6e7e82a9bd90d3935caaca1b
input-file:
- $(repo)/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/dataCollectionEndpoints_API.json
@@ -46,17 +46,66 @@ title: DataCollectionRule
module-version: 0.1.0
namespace: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection
subject-prefix: ''
-resourcegroup-append: true
-nested-object-to-string: true
-
-use-extension:
- "@autorest/powershell": "4.x"
directive:
+ # custom required body
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}"].put.parameters
+ transform: >-
+ return [
+ {
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/4f4044394791773e6e7e82a9bd90d3935caaca1b/specification/common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
+ },
+ {
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/4f4044394791773e6e7e82a9bd90d3935caaca1b/specification/common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/DataCollectionRuleNameParameter"
+ },
+ {
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/4f4044394791773e6e7e82a9bd90d3935caaca1b/specification/common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
+ },
+ {
+ "in": "body",
+ "name": "body",
+ "description": "The payload",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/DataCollectionRuleResource"
+ }
+ }
+ ]
+ - from: swagger-document
+ where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}"].put.parameters
+ transform: >-
+ return [
+ {
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/4f4044394791773e6e7e82a9bd90d3935caaca1b/specification/common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
+ },
+ {
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/4f4044394791773e6e7e82a9bd90d3935caaca1b/specification/common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter"
+ },
+ {
+ "$ref": "#/parameters/DataCollectionEndpointNameParameter"
+ },
+ {
+ "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/4f4044394791773e6e7e82a9bd90d3935caaca1b/specification/common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
+ },
+ {
+ "in": "body",
+ "name": "body",
+ "description": "The payload",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/DataCollectionEndpointResource"
+ }
+ }
+ ]
+ # remove tag patch, add resource put by autorest
- remove-operation: DataCollectionRules_Update
-# # Following is two common directive which are normally required in all the RPs
-# # 1. Remove the unexpanded parameter set
-# # 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
+ # Following is two common directive which are normally required in all the RPs
+ # 1. Remove the unexpanded parameter set
+ # 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^UpdateViaJsonFilePath$|^UpdateViaJsonString$
remove: true
@@ -101,7 +150,7 @@ directive:
set:
alias: EndpointName
# model cmdlet
- - from: dataCollectionRules_API.json
+ - from: swagger-document
where: $.definitions.ExtensionDataSource.properties.extensionSettings
transform: >-
return {
diff --git a/src/Monitor/DataCollectionRule.Autorest/generate-portal-ux.ps1 b/src/Monitor/DataCollectionRule.Autorest/generate-portal-ux.ps1
index 9c64ef9ee456..a7d1a9e51ab8 100644
--- a/src/Monitor/DataCollectionRule.Autorest/generate-portal-ux.ps1
+++ b/src/Monitor/DataCollectionRule.Autorest/generate-portal-ux.ps1
@@ -42,8 +42,6 @@ $instance = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Module]::
$moduleInfo = Get-Module -Name $moduleName
$parameterSetsInfo = Get-Module -Name "$moduleName.private"
-$buildinFunctions = @("Export-CmdletSurface", "Export-ExampleStub", "Export-FormatPs1xml", "Export-HelpMarkdown", "Export-ModelSurface", "Export-ProxyCmdlet", "Export-Psd1", "Export-TestStub", "Get-CommonParameter", "Get-ModuleGuid", "Get-ScriptCmdlet")
-
function Test-FunctionSupported()
{
[CmdletBinding()]
@@ -53,12 +51,12 @@ function Test-FunctionSupported()
$FunctionName
)
- If ($buildinfunctions.Contains($FunctionName)) {
+ If (-not $FunctionName.Contains("_")) {
return $false
}
$cmdletName, $parameterSetName = $FunctionName.Split("_")
- If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity")) {
+ If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity") -or $parameterSetName.Contains("ViaJson")) {
return $false
}
If ($cmdletName.StartsWith("New") -or $cmdletName.StartsWith("Set") -or $cmdletName.StartsWith("Update")) {
@@ -311,7 +309,7 @@ function New-MetadataForCmdlet()
return $result
}
-$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-functionSupported($_) }
+$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-FunctionSupported($_) }
$resourceTypes = @{}
foreach ($parameterSetName in $parameterSets)
{
diff --git a/src/Monitor/DataCollectionRule.Autorest/generated/Module.cs b/src/Monitor/DataCollectionRule.Autorest/generated/Module.cs
index 2831545a14fe..6d5d7aff867c 100644
--- a/src/Monitor/DataCollectionRule.Autorest/generated/Module.cs
+++ b/src/Monitor/DataCollectionRule.Autorest/generated/Module.cs
@@ -26,12 +26,20 @@ public partial class Module
public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler();
+ private static bool _init = false;
+
+ private static readonly global::System.Object _initLock = new global::System.Object();
+
+ private static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Module _instance;
+
/// the ISendAsync pipeline instance
private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime.HttpPipeline _pipeline;
/// the ISendAsync pipeline instance (when proxy is enabled)
private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime.HttpPipeline _pipelineWithProxy;
+ private static readonly global::System.Object _singletonLock = new global::System.Object();
+
public bool _useProxy = false;
public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy();
@@ -51,11 +59,8 @@ public partial class Module
/// The delegate to get the telemetry Id.
public GetTelemetryIdDelegate GetTelemetryId { get; set; }
- /// Backing field for property.
- private static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Module _instance;
-
/// the singleton of this module class
- public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Module());
+ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } }
/// The Name of this module
public string Name => @"Az.DataCollectionRule";
@@ -117,9 +122,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime.HttpPip
/// Initialization steps performed after the module is loaded.
public void Init()
{
- OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } );
- OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } );
- CustomInit();
+ if (_init == false)
+ {
+ lock (_initLock) {
+ if (_init == false) {
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } );
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } );
+ CustomInit();
+ _init = true;
+ }
+ }
+ }
}
/// Creates the module instance.
diff --git a/src/Monitor/DataCollectionRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/src/Monitor/DataCollectionRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs
index 2292b618a121..5f99a3f5d2bc 100644
--- a/src/Monitor/DataCollectionRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs
+++ b/src/Monitor/DataCollectionRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs
@@ -56,6 +56,31 @@ protected override void ProcessRecord()
return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_})
}
}
+function Start-TestSleep {
+ [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')]
+ param(
+ [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')]
+ [ValidateRange(0.0, 2147483.0)]
+ [double] $Seconds,
+
+ [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')]
+ [ValidateRange('NonNegative')]
+ [Alias('ms')]
+ [int] $Milliseconds
+ )
+
+ if ($TestMode -ne 'playback') {
+ switch ($PSCmdlet.ParameterSetName) {
+ 'SleepBySeconds' {
+ Start-Sleep -Seconds $Seconds
+ }
+ 'SleepByMilliseconds' {
+ Start-Sleep -Milliseconds $Milliseconds
+ }
+ }
+ }
+}
+
$env = @{}
if ($UsePreviousConfigForRecord) {
$previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json
diff --git a/src/Monitor/DiagnosticSetting.Autorest/README.md b/src/Monitor/DiagnosticSetting.Autorest/README.md
index e44e478704a6..66b293d497f9 100644
--- a/src/Monitor/DiagnosticSetting.Autorest/README.md
+++ b/src/Monitor/DiagnosticSetting.Autorest/README.md
@@ -29,15 +29,16 @@ For information on how to develop for `Az.DiagnosticSetting`, see [how-to.md](ho
### AutoRest Configuration
> see https://aka.ms/autorest
``` yaml
+commit: e94b0da0c7f80e2986af90c1dd7e9c8f4c336c61
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
# You need to specify your swagger files here.
- - https://github.com/Azure/azure-rest-api-specs/blob/62ec79080af0d0d609650d67155ef4a93ae11482/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/diagnosticsSettings_API.json
- - https://github.com/Azure/azure-rest-api-specs/blob/62ec79080af0d0d609650d67155ef4a93ae11482/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/diagnosticsSettingsCategories_API.json
- - https://github.com/Azure/azure-rest-api-specs/blob/62ec79080af0d0d609650d67155ef4a93ae11482/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/subscriptionDiagnosticsSettings_API.json
- - https://github.com/Azure/azure-rest-api-specs/blob/e94b0da0c7f80e2986af90c1dd7e9c8f4c336c61/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/eventCategories_API.json
+ - $(repo)/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/diagnosticsSettings_API.json
+ - $(repo)/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/diagnosticsSettingsCategories_API.json
+ - $(repo)/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/subscriptionDiagnosticsSettings_API.json
+ - $(repo)/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/eventCategories_API.json
root-module-name: $(prefix).Monitor
title: DiagnosticSetting
@@ -50,6 +51,10 @@ nested-object-to-string: true
# uncomment following line to support viaIdentity for these post APIs
# identity-correction-for-post: true
+# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
+use-extension:
+ "@autorest/powershell": "3.x"
+
directive:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
diff --git a/src/Monitor/MetricsData.Autorest/Az.Metric.csproj b/src/Monitor/MetricsData.Autorest/Az.Metric.csproj
new file mode 100644
index 000000000000..6804784a69be
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/Az.Metric.csproj
@@ -0,0 +1,10 @@
+
+
+ Metric
+ Monitor
+ MetricsData.Autorest
+
+
+
+
+
diff --git a/src/Monitor/MetricsData.Autorest/Az.Metric.format.ps1xml b/src/Monitor/MetricsData.Autorest/Az.Metric.format.ps1xml
new file mode 100644
index 000000000000..649bb3486a5e
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/Az.Metric.format.ps1xml
@@ -0,0 +1,255 @@
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorDetail
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorDetail#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+ Target
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableString
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableString#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ LocalizedValue
+
+
+ Value
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetadataValue
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetadataValue#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Value
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.Metric
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.Metric#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DisplayDescription
+
+
+ ErrorCode
+
+
+ ErrorMessage
+
+
+ Unit
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricIdentity
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricIdentity#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ SubscriptionId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricResultsResponseValuesItem
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricResultsResponseValuesItem#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Endtime
+
+
+ Interval
+
+
+ Namespace
+
+
+ Resourceid
+
+
+ Resourceregion
+
+
+ Starttime
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricValue
+
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricValue#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Average
+
+
+ Count
+
+
+ Maximum
+
+
+ Minimum
+
+
+ TimeStamp
+
+
+ Total
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/Az.Metric.psd1 b/src/Monitor/MetricsData.Autorest/Az.Metric.psd1
new file mode 100644
index 000000000000..854b23482e3c
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/Az.Metric.psd1
@@ -0,0 +1,23 @@
+@{
+ GUID = '405fa9b2-77ec-4b07-8793-e29abba71a28'
+ RootModule = './Az.Metric.psm1'
+ ModuleVersion = '0.1.0'
+ CompatiblePSEditions = 'Core', 'Desktop'
+ Author = 'Microsoft Corporation'
+ CompanyName = 'Microsoft Corporation'
+ Copyright = 'Microsoft Corporation. All rights reserved.'
+ Description = 'Microsoft Azure PowerShell: Metric cmdlets'
+ PowerShellVersion = '5.1'
+ DotNetFrameworkVersion = '4.7.2'
+ RequiredAssemblies = './bin/Az.Metric.private.dll'
+ FormatsToProcess = './Az.Metric.format.ps1xml'
+ FunctionsToExport = 'Get-AzMetricsBatch'
+ PrivateData = @{
+ PSData = @{
+ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Metric'
+ LicenseUri = 'https://aka.ms/azps-license'
+ ProjectUri = 'https://github.com/Azure/azure-powershell'
+ ReleaseNotes = ''
+ }
+ }
+}
diff --git a/src/Monitor/MetricsData.Autorest/Az.Metric.psm1 b/src/Monitor/MetricsData.Autorest/Az.Metric.psm1
new file mode 100644
index 000000000000..9463514623b6
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/Az.Metric.psm1
@@ -0,0 +1,115 @@
+# region Generated
+ # ----------------------------------------------------------------------------------
+ # Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+ # ----------------------------------------------------------------------------------
+ # Load required Az.Accounts module
+ $accountsName = 'Az.Accounts'
+ $accountsModule = Get-Module -Name $accountsName
+ if(-not $accountsModule) {
+ $localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
+ if(Test-Path -Path $localAccountsPath) {
+ $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
+ if($localAccounts) {
+ $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
+ }
+ }
+ if(-not $accountsModule) {
+ $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
+ if($hasAdequateVersion) {
+ $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
+ }
+ }
+ }
+
+ if(-not $accountsModule) {
+ Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
+ } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
+ Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
+ }
+ Write-Information "Loaded Module '$($accountsModule.Name)'"
+
+ # Load the private module dll
+ $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.Metric.private.dll')
+
+ # Get the private module's instance
+ $instance = [Microsoft.Azure.PowerShell.Cmdlets.Metric.Module]::Instance
+
+ # Ask for the shared functionality table
+ $VTable = Register-AzModule
+
+ # Tweaks the pipeline on module load
+ $instance.OnModuleLoad = $VTable.OnModuleLoad
+
+ # Following two delegates are added for telemetry
+ $instance.GetTelemetryId = $VTable.GetTelemetryId
+ $instance.Telemetry = $VTable.Telemetry
+
+
+ # Tweaks the pipeline per call
+ $instance.OnNewRequest = $VTable.OnNewRequest
+
+ # Gets shared parameter values
+ $instance.GetParameterValue = $VTable.GetParameterValue
+
+ # Allows shared module to listen to events from this module
+ $instance.EventListener = $VTable.EventListener
+
+ # Gets shared argument completers
+ $instance.ArgumentCompleter = $VTable.ArgumentCompleter
+
+ # The name of the currently selected Azure profile
+ $instance.ProfileName = $VTable.ProfileName
+
+
+ # Load the custom module
+ $customModulePath = Join-Path $PSScriptRoot './custom/Az.Metric.custom.psm1'
+ if(Test-Path $customModulePath) {
+ $null = Import-Module -Name $customModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export proxy cmdlet scripts
+ $exportsPath = Join-Path $PSScriptRoot './exports'
+ $directories = Get-ChildItem -Directory -Path $exportsPath
+ $profileDirectory = $null
+ if($instance.ProfileName) {
+ if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
+ $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
+ } else {
+ # Don't export anything if the profile doesn't exist for the module
+ $exportsPath = $null
+ Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
+ }
+ } elseif(($directories | Measure-Object).Count -gt 0) {
+ # Load the last folder if no profile is selected
+ $profileDirectory = $directories | Select-Object -Last 1
+ }
+
+ if($profileDirectory) {
+ Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
+ $exportsPath = $profileDirectory.FullName
+ }
+
+ if($exportsPath) {
+ Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
+ Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
+ }
+
+ # Finalize initialization of this module
+ $instance.Init();
+ Write-Information "Loaded Module '$($instance.Name)'"
+# endregion
diff --git a/src/Monitor/MetricsData.Autorest/README.md b/src/Monitor/MetricsData.Autorest/README.md
new file mode 100644
index 000000000000..b6567f444c89
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/README.md
@@ -0,0 +1,84 @@
+
+# Az.Metric
+This directory contains the PowerShell module for the Metric service.
+
+---
+## Status
+[](https://www.powershellgallery.com/packages/Az.Metric/)
+
+## Info
+- Modifiable: yes
+- Generated: all
+- Committed: yes
+- Packaged: yes
+
+---
+## Detail
+This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
+
+## Module Requirements
+- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
+
+## Authentication
+AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
+
+## Development
+For information on how to develop for `Az.Metric`, see [how-to.md](how-to.md).
+
+
+### AutoRest Configuration
+> see https://aka.ms/autorest
+
+```yaml
+# pin the swagger version by using the commit id instead of branch name
+require:
+# readme.azure.noprofile.md is the common configuration file
+ - $(this-folder)/../../readme.azure.noprofile.md
+commit: 0373f0edc4414fd402603fac51d0df93f1f70507
+
+input-file:
+ - $(repo)/specification/monitor/data-plane/Microsoft.Insights/stable/2023-10-01/metricBatch.json
+
+root-module-name: $(prefix).Monitor
+title: Metric
+module-name: Az.Metric
+module-version: 0.1.0
+subject-prefix: ""
+
+directive:
+ - where:
+ subject: BatchMetricsBatch
+ verb: Invoke
+ set:
+ verb: Get
+ subject: MetricsBatch
+ - where:
+ subject: MetricsBatch
+ variant: ^(Batch)(?!.*?Expanded)
+ remove: true
+ # Case Sensitive
+ - where:
+ parameter-name: Metricname
+ set:
+ parameter-name: Name
+ alias: MetricName
+ - where:
+ parameter-name: Metricnamespace
+ set:
+ parameter-name: Namespace
+ alias: MetricNamespace
+ - where:
+ subject: MetricsBatch
+ parameter-name: Starttime
+ set:
+ parameter-name: StartTime
+ - where:
+ subject: MetricsBatch
+ parameter-name: Endtime
+ set:
+ parameter-name: EndTime
+ - where:
+ subject: MetricsBatch
+ parameter-name: Resourceid
+ set:
+ parameter-name: ResourceId
diff --git a/src/Monitor/MetricsData.Autorest/build-module.ps1 b/src/Monitor/MetricsData.Autorest/build-module.ps1
new file mode 100644
index 000000000000..c5d901d1cf42
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/build-module.ps1
@@ -0,0 +1,180 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
+$ErrorActionPreference = 'Stop'
+
+if($PSEdition -ne 'Core') {
+ Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.'
+}
+
+if(-not $NotIsolated -and -not $Debugger) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+
+ if($LastExitCode -ne 0) {
+ # Build failed. Don't attempt to run the module.
+ return
+ }
+
+ if($Test) {
+ . (Join-Path $PSScriptRoot 'test-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Tests failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Docs) {
+ . (Join-Path $PSScriptRoot 'generate-help.ps1')
+ if($LastExitCode -ne 0) {
+ # Docs generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($UX) {
+ . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
+ if($LastExitCode -ne 0) {
+ # UX generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Pack) {
+ . (Join-Path $PSScriptRoot 'pack-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Packing failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1'
+ if($Code) {
+ . $runModulePath -Code
+ } elseif($Run) {
+ . $runModulePath
+ } else {
+ Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script."
+ }
+ return
+}
+
+$binFolder = Join-Path $PSScriptRoot 'bin'
+$objFolder = Join-Path $PSScriptRoot 'obj'
+
+if(-not $Debugger) {
+ Write-Host -ForegroundColor Green 'Cleaning build folders...'
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
+
+ if((Test-Path $binFolder) -or (Test-Path $objFolder)) {
+ Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?'
+ Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.'
+ }
+
+ Write-Host -ForegroundColor Green 'Compiling module...'
+ $buildConfig = 'Debug'
+ if($Release) {
+ $buildConfig = 'Release'
+ }
+ dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo
+ if($LastExitCode -ne 0) {
+ Write-Error 'Compilation failed.'
+ }
+
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.Metric.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+
+# Load DLL to use build-time cmdlets
+$null = Import-Module -Name $dll
+
+$modulePaths = $dll
+$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.Metric.custom.psm1'
+if(Test-Path $customPsm1) {
+ $modulePaths = @($dll, $customPsm1)
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(Test-Path $exportsFolder) {
+ $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $exportsFolder
+
+$internalFolder = Join-Path $PSScriptRoot 'internal'
+if(Test-Path $internalFolder) {
+ $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $internalFolder
+
+$psd1 = Join-Path $PSScriptRoot './Az.Metric.psd1'
+$guid = Get-ModuleGuid -Psd1Path $psd1
+$moduleName = 'Az.Metric'
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+$null = New-Item -ItemType Directory -Force -Path $examplesFolder
+
+Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
+$modelCmdlets = @()
+$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
+if (Test-Path $modelCmdletFolder) {
+ $null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
+}
+if ($modelCmdlets.Count -gt 0) {
+ . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
+ CreateModelCmdlet($modelCmdlets)
+}
+
+if($NoDocs) {
+ Write-Host -ForegroundColor Green 'Creating exports...'
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder
+} else {
+ Write-Host -ForegroundColor Green 'Creating exports and docs...'
+ $moduleDescription = 'Microsoft Azure PowerShell: Metric cmdlets'
+ $docsFolder = Join-Path $PSScriptRoot 'docs'
+ if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+ }
+ $null = New-Item -ItemType Directory -Force -Path $docsFolder
+ $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
+}
+
+Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
+$formatPs1xml = Join-Path $PSScriptRoot './Az.Metric.format.ps1xml'
+Export-FormatPs1xml -FilePath $formatPs1xml
+
+Write-Host -ForegroundColor Green 'Creating psd1...'
+$customFolder = Join-Path $PSScriptRoot 'custom'
+Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid
+
+Write-Host -ForegroundColor Green 'Creating test stubs...'
+$testFolder = Join-Path $PSScriptRoot 'test'
+$null = New-Item -ItemType Directory -Force -Path $testFolder
+Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder
+
+Write-Host -ForegroundColor Green 'Creating example stubs...'
+Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
+
+if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
+{
+ Write-Host -ForegroundColor Green 'Creating ux metadata...'
+ . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
+}
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
diff --git a/src/Monitor/MetricsData.Autorest/check-dependencies.ps1 b/src/Monitor/MetricsData.Autorest/check-dependencies.ps1
new file mode 100644
index 000000000000..90ca9867ae40
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/check-dependencies.ps1
@@ -0,0 +1,65 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
+$ErrorActionPreference = 'Stop'
+
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
+ if($predicate) {
+ $module = Get-Module -ListAvailable -Name $moduleName
+ if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) {
+ $null = New-Item -ItemType Directory -Force -Path $path
+ Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
+ if ($requiredVersion) {
+ Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
+ }elseif($versionMinimum) {
+ Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
+ } else {
+ Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
+ }
+ }
+ }
+}
+
+$ProgressPreference = 'SilentlyContinue'
+$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1
+
+$localModulesPath = Join-Path $PSScriptRoot 'generated\modules'
+if(Test-Path -Path $localModulesPath) {
+ $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
+}
+
+DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5'
+DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
+
+$tools = Join-Path $PSScriptRoot 'tools'
+$resourceDir = Join-Path $tools 'Resources'
+$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1'
+
+if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) {
+ Write-Host -ForegroundColor Green "Building local Resource module used for test..."
+ Set-Location $resourceDir
+ $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources
+ $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/
+ Set-Location $HOME/.PSSharedModules/Resources
+ $null = .\build-module.ps1
+ Set-Location $PSScriptRoot
+}
diff --git a/src/Monitor/MetricsData.Autorest/create-model-cmdlets.ps1 b/src/Monitor/MetricsData.Autorest/create-model-cmdlets.ps1
new file mode 100644
index 000000000000..33ee855efd09
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/create-model-cmdlets.ps1
@@ -0,0 +1,262 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+function CreateModelCmdlet {
+
+ param([Hashtable[]]$Models)
+
+ if ($Models.Count -eq 0)
+ {
+ return
+ }
+
+ $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
+ $OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
+ $null = New-Item -ItemType Directory -Force -Path $OutputDir
+ if ('Az.Monitor'.length -gt 0) {
+ $ModuleName = 'Az.Monitor'
+ } else {
+ $ModuleName = 'Az.Metric'
+ }
+ $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
+ $Content = ''
+ $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 )
+ { $Content += get-content $_.fullname -raw
+ } }
+
+ $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content)
+ $Nodes = $Tree.ChildNodes().ChildNodes()
+ $classConstantMember = @{}
+ foreach ($Model in $Models)
+ {
+ $ModelName = $Model.modelName
+ $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$ModelName") }
+ $ClassNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'class') -and ($_.Identifier.value -eq "$ModelName") }
+ $classConstantMember = @()
+ foreach ($class in $ClassNode) {
+ foreach ($member in $class.Members) {
+ $isConstant = $false
+ foreach ($attr in $member.AttributeLists) {
+ $memberName = $attr.Attributes.Name.ToString()
+ if ($memberName.EndsWith('.Constant')) {
+ $isConstant = $true
+ break
+ }
+ }
+ if (($member.Modifiers.ToString() -eq 'public') -and $isConstant) {
+ $classConstantMember += $member.Identifier.Value
+ }
+ }
+ }
+ if ($InterfaceNode.count -eq 0) {
+ continue
+ }
+ # through a queue, we iterate all the parent models.
+ $Queue = @($InterfaceNode)
+ $visited = @("I$ModelName")
+ $AllInterfaceNodes = @()
+ while ($Queue.count -ne 0)
+ {
+ $AllInterfaceNodes += $Queue[0]
+ # Baselist contains the direct parent models.
+ foreach ($parent in $Queue[0].BaseList.Types)
+ {
+ if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value)))
+ {
+ $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) })
+ $visited = [Array]$visited + $parent.Type.Right.Identifier.Value
+ }
+ }
+ $first, $Queue = $Queue
+ }
+
+ $Namespace = $InterfaceNode.Parent.Name
+ $ObjectType = $ModelName
+ $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
+ # remove duplicated module name
+ if ($ObjectType.StartsWith('')) {
+ $ModulePrefix = ''
+ } else {
+ $ModulePrefix = ''
+ }
+ $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
+
+ $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string]
+ $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string]
+ foreach ($Node in $AllInterfaceNodes)
+ {
+ foreach ($Member in $Node.Members)
+ {
+ if ($classConstantMember.Contains($Member.Identifier.Value)) {
+ # skip constant member
+ continue
+ }
+ $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments
+ $Required = $false
+ $Description = ""
+ $Readonly = $False
+ $mutability = @{Read = $true; Create = $true; Update = $true}
+ foreach ($Argument in $Arguments)
+ {
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Required")
+ {
+ $Required = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Description")
+ {
+ $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"')
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly")
+ {
+ $Readonly = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Read")
+ {
+ $mutability.Read = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Create")
+ {
+ $mutability.Create = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Update")
+ {
+ $mutability.Update = $Argument.Expression.Token.Value
+ }
+ }
+ if ($Readonly)
+ {
+ continue
+ }
+ $Identifier = $Member.Identifier.Value
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
+ if ($Type.StartsWith("System.Collections.Generic.List"))
+ {
+ # if the type is a list, we need to convert it to array
+ $matched = $Type -match '\<(?.+)\>$'
+ if ($matched)
+ {
+ $Type = $matches.Name + '[]';
+ }
+ }
+ $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string]
+ if ($Required -and $mutability.Create -and $mutability.Update)
+ {
+ $ParameterDefinePropertyList.Add("Mandatory")
+ }
+ if ($Description -ne "")
+ {
+ $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"")
+ }
+ $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList)
+ # check whether completer is needed
+ $completer = '';
+ if(IsEnumType($Member)){
+ $completer += GetCompleter($Member)
+ }
+ $ParameterDefineScript = "
+ [Parameter($ParameterDefineProperty)]${completer}
+ [${Type}]
+ `$${Identifier}"
+ $ParameterDefineScriptList.Add($ParameterDefineScript)
+ $ParameterAssignScriptList.Add("
+ if (`$PSBoundParameters.ContainsKey('${Identifier}')) {
+ `$Object.${Identifier} = `$${Identifier}
+ }")
+ }
+ }
+ $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator ","
+ $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator ""
+
+ $cmdletName = "New-Az${ModulePrefix}${ObjectType}Object"
+ if ('' -ne $Model.cmdletName) {
+ $cmdletName = $Model.cmdletName
+ }
+ $OutputPath = Join-Path -ChildPath "${cmdletName}.ps1" -Path $OutputDir
+ $cmdletNameInLowerCase = $cmdletName.ToLower()
+ $Script = "
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the ""License"");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an ""AS IS"" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create an in-memory object for ${ObjectType}.
+.Description
+Create an in-memory object for ${ObjectType}.
+
+.Outputs
+${ObjectTypeWithNamespace}
+.Link
+https://learn.microsoft.com/powershell/module/${ModuleName}/${cmdletNameInLowerCase}
+#>
+function ${cmdletName} {
+ [OutputType('${ObjectTypeWithNamespace}')]
+ [CmdletBinding(PositionalBinding=`$false)]
+ Param(
+${ParameterDefineScript}
+ )
+
+ process {
+ `$Object = [${ObjectTypeWithNamespace}]::New()
+${ParameterAssignScript}
+ return `$Object
+ }
+}
+"
+ Set-Content -Path $OutputPath -Value $Script
+ }
+}
+
+function IsEnumType {
+ param (
+ [Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax]$property
+ )
+ $isEnum = $false
+ foreach ($attr in $property.AttributeLists) {
+ $attributeName = $attr.Attributes.Name.ToString()
+ if ($attributeName.Contains('ArgumentCompleter')) {
+ $isEnum = $true
+ break
+ }
+ }
+ return $isEnum;
+}
+
+function GetCompleter {
+ param (
+ [Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax]$property
+ )
+ foreach ($attr in $property.AttributeLists) {
+ $attributeName = $attr.Attributes.Name.ToString()
+ if ($attributeName.Contains('ArgumentCompleter')) {
+ $attributeName = $attributeName.Split("::")[-1]
+ $possibleValues = [System.String]::Join(", ", $attr.Attributes.ArgumentList.Arguments)
+ $completer += "`n [${attributeName}(${possibleValues})]"
+ return $completer
+ }
+ }
+}
diff --git a/src/Monitor/MetricsData.Autorest/custom/Az.Metric.custom.psm1 b/src/Monitor/MetricsData.Autorest/custom/Az.Metric.custom.psm1
new file mode 100644
index 000000000000..2642e95e5238
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/custom/Az.Metric.custom.psm1
@@ -0,0 +1,17 @@
+# region Generated
+ # Load the private module dll
+ $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Metric.private.dll')
+
+ # Load the internal module
+ $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Metric.internal.psm1'
+ if(Test-Path $internalModulePath) {
+ $null = Import-Module -Name $internalModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export script cmdlets
+ Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias)
+# endregion
diff --git a/src/Monitor/MetricsData.Autorest/custom/README.md b/src/Monitor/MetricsData.Autorest/custom/README.md
new file mode 100644
index 000000000000..6cefe17280c0
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/custom/README.md
@@ -0,0 +1,41 @@
+# Custom
+This directory contains custom implementation for non-generated cmdlets for the `Az.Metric` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.Metric.custom.psm1`. This file should not be modified.
+
+## Info
+- Modifiable: yes
+- Generated: partial
+- Committed: yes
+- Packaged: yes
+
+## Details
+For `Az.Metric` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*.
+
+For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.Metric.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
+
+For script cmdlets, these are loaded via the `Az.Metric.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
+
+## Purpose
+This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
+
+## Usage
+The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
+- Break
+- DefaultProfile
+- HttpPipelineAppend
+- HttpPipelinePrepend
+- Proxy
+- ProxyCredential
+- ProxyUseDefaultCredentials
+
+These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.Metric`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
+
+### Attributes
+For processing the cmdlets, we've created some additional attributes:
+- `Microsoft.Azure.PowerShell.Cmdlets.Metric.DescriptionAttribute`
+ - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
+- `Microsoft.Azure.PowerShell.Cmdlets.Metric.DoNotExportAttribute`
+ - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Metric`.
+- `Microsoft.Azure.PowerShell.Cmdlets.Metric.InternalExportAttribute`
+ - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.Metric`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
+- `Microsoft.Azure.PowerShell.Cmdlets.Metric.ProfileAttribute`
+ - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/examples/Get-AzMetricsBatch.md b/src/Monitor/MetricsData.Autorest/examples/Get-AzMetricsBatch.md
new file mode 100644
index 000000000000..e873a0f576e5
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/examples/Get-AzMetricsBatch.md
@@ -0,0 +1,537 @@
+### Example 1: Get ingress and egress from storage account
+```powershell
+$endpoint = 'https://eastus.metrics.monitor.azure.com'
+$start = "2023-12-06T07:00:00.000Z"
+$end = "2023-12-06T08:00:00.000Z"
+Get-AzMetricsBatch -Endpoint $endpoint -Name 'ingress','egress' -Namespace "Microsoft.Storage/storageAccounts" -EndTime $end -StartTime $start -ResourceId /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/joyer-monitor/providers/Microsoft.Storage/storageAccounts/psmetric01
+```
+
+```output
+Endtime : 2023-12-06T08:00:00Z
+Interval : 00:01:00a
+Namespace : Microsoft.Storage/storageAccounts
+Resourceid : /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/joyer-monitor/providers/Microsoft.Storage/storageAccounts/psmetric01
+Resourceregion : eastus
+Starttime : 2023-12-06T07:00:00Z
+Value : {{
+ "name": {
+ "value": "Ingress",
+ "localizedValue": "Ingress"
+ },
+ "id": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/joyer-monitor/providers/Microsoft.Storage/storageAccounts/psmetric01/providers/Microsoft.Insigh
+ ts/metrics/Ingress",
+ "type": "Microsoft.Insights/metrics",
+ "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.",
+ "errorCode": "Success",
+ "unit": "Bytes",
+ "timeseries": [
+ {
+ "metadatavalues": [ ],
+ "data": [
+ {
+ "timeStamp": "2023-12-06T07:00:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:01:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:02:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:03:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:04:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:05:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:06:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:07:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:08:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:09:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:10:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:11:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:12:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:13:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:14:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:15:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:16:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:17:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:18:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:19:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:20:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:21:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:22:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:23:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:24:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:25:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:26:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:27:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:28:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:29:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:30:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:31:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:32:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:33:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:34:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:35:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:36:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:37:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:38:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:39:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:40:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:41:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:42:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:43:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:44:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:45:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:46:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:47:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:48:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:49:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:50:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:51:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:52:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:53:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:54:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:55:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:56:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:57:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:58:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:59:00.0000000Z",
+ "total": 0
+ }
+ ]
+ }
+ ]
+ }, {
+ "name": {
+ "value": "Egress",
+ "localizedValue": "Egress"
+ },
+ "id": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/joyer-monitor/providers/Microsoft.Storage/storageAccounts/psmetric01/providers/Microsoft.Insigh
+ ts/metrics/Egress",
+ "type": "Microsoft.Insights/metrics",
+ "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this
+ number does not reflect billable egress.",
+ "errorCode": "Success",
+ "unit": "Bytes",
+ "timeseries": [
+ {
+ "metadatavalues": [ ],
+ "data": [
+ {
+ "timeStamp": "2023-12-06T07:00:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:01:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:02:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:03:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:04:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:05:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:06:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:07:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:08:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:09:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:10:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:11:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:12:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:13:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:14:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:15:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:16:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:17:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:18:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:19:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:20:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:21:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:22:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:23:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:24:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:25:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:26:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:27:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:28:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:29:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:30:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:31:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:32:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:33:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:34:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:35:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:36:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:37:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:38:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:39:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:40:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:41:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:42:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:43:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:44:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:45:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:46:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:47:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:48:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:49:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:50:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:51:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:52:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:53:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:54:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:55:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:56:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:57:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:58:00.0000000Z",
+ "total": 0
+ },
+ {
+ "timeStamp": "2023-12-06T07:59:00.0000000Z",
+ "total": 0
+ }
+ ]
+ }
+ ]
+ }}
+```
+
+This command lists the metric values for specified resources.
+
diff --git a/src/Monitor/MetricsData.Autorest/export-surface.ps1 b/src/Monitor/MetricsData.Autorest/export-surface.ps1
new file mode 100644
index 000000000000..0cf4a618a79c
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/export-surface.ps1
@@ -0,0 +1,41 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.Metric.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+$null = Import-Module -Name $dll
+
+$moduleName = 'Az.Metric'
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+$resourcesFolder = Join-Path $PSScriptRoot 'resources'
+
+Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'"
+
+Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'"
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/exports/Get-AzMetricsBatch.ps1 b/src/Monitor/MetricsData.Autorest/exports/Get-AzMetricsBatch.ps1
new file mode 100644
index 000000000000..52ddfc10df7a
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/exports/Get-AzMetricsBatch.ps1
@@ -0,0 +1,295 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Lists the metric values for multiple resources.
+.Description
+Lists the metric values for multiple resources.
+.Example
+$endpoint = 'https://eastus.metrics.monitor.azure.com'
+$start = "2023-12-06T07:00:00.000Z"
+$end = "2023-12-06T08:00:00.000Z"
+Get-AzMetricsBatch -Endpoint $endpoint -Name 'ingress','egress' -Namespace "Microsoft.Storage/storageAccounts" -EndTime $end -StartTime $start -ResourceId /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/joyer-monitor/providers/Microsoft.Storage/storageAccounts/psmetric01
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [Id ]: Resource identity path
+ [SubscriptionId ]: The subscription identifier for the resources in this batch.
+.Link
+https://learn.microsoft.com/powershell/module/az.monitor/get-azmetricsbatch
+#>
+function Get-AzMetricsBatch {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse])]
+[CmdletBinding(DefaultParameterSetName='BatchExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Uri')]
+ [System.String]
+ # The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com.
+ # The region should match the region of the requested resources.
+ # For global resources, the region should be 'global'.
+ ${Endpoint},
+
+ [Parameter(ParameterSetName='BatchExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The subscription identifier for the resources in this batch.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='BatchViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(Mandatory)]
+ [Alias('MetricName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(Required, PossibleTypes=([System.String]))]
+ [System.Collections.Generic.List[System.String]]
+ # The names of the metrics (comma separated) to retrieve.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Alias('MetricNamespace')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # Metric namespace that contains the requested metric names.
+ ${Namespace},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The list of aggregation types (comma separated) to retrieve.
+ # *Examples: average, minimum, maximum*
+ ${Aggregation},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The end time of the query.
+ # It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ ${EndTime},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The filter is used to reduce the set of metric data returned.
+ # Example:
+ # Metric contains metadata A, B and C.
+ # - Return all time series of C where A = a1 and B = b1 or b2
+ # **filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
+ # - Invalid variant:
+ # **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
+ # This is invalid because the logical or operator cannot separate two different metadata names.
+ # - Return all time series where A = a1, B = b1 and C = c1:
+ # **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
+ # - Return all time series where A = a1
+ # **filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.
+ ${Filter},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The interval (i.e.
+ # timegrain) of the query in ISO 8601 duration format.
+ # Defaults to PT1M.
+ # Special case for 'FULL' value that returns single datapoint for entire time span requested.
+ # *Examples: PT15M, PT1H, P1D, FULL*
+ ${Interval},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The aggregation to use for sorting results and the direction of the sort.
+ # Only one order can be specified.
+ # *Examples: sum asc*
+ ${Orderby},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # Dimension name(s) to rollup results by.
+ # For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.
+ ${Rollupby},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The start time of the query.
+ # It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ # If you have specified the endtime parameter, then this parameter is required.
+ # If only starttime is specified, then endtime defaults to the current time.
+ # If no time interval is specified, the default is 1 hour.
+ ${StartTime},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.Int32]
+ # The maximum number of records to retrieve per resource ID in the request.
+ # Valid only if filter is specified.
+ # Defaults to 10.
+ ${Top},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Body')]
+ [System.String[]]
+ # The list of resource IDs to query metrics for.
+ ${ResourceId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ BatchExpanded = 'Az.Metric.private\Get-AzMetricsBatch_BatchExpanded';
+ BatchViaIdentityExpanded = 'Az.Metric.private\Get-AzMetricsBatch_BatchViaIdentityExpanded';
+ }
+ if (('BatchExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Monitor/MetricsData.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/Monitor/MetricsData.Autorest/exports/ProxyCmdletDefinitions.ps1
new file mode 100644
index 000000000000..52ddfc10df7a
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/exports/ProxyCmdletDefinitions.ps1
@@ -0,0 +1,295 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Lists the metric values for multiple resources.
+.Description
+Lists the metric values for multiple resources.
+.Example
+$endpoint = 'https://eastus.metrics.monitor.azure.com'
+$start = "2023-12-06T07:00:00.000Z"
+$end = "2023-12-06T08:00:00.000Z"
+Get-AzMetricsBatch -Endpoint $endpoint -Name 'ingress','egress' -Namespace "Microsoft.Storage/storageAccounts" -EndTime $end -StartTime $start -ResourceId /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/joyer-monitor/providers/Microsoft.Storage/storageAccounts/psmetric01
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [Id ]: Resource identity path
+ [SubscriptionId ]: The subscription identifier for the resources in this batch.
+.Link
+https://learn.microsoft.com/powershell/module/az.monitor/get-azmetricsbatch
+#>
+function Get-AzMetricsBatch {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse])]
+[CmdletBinding(DefaultParameterSetName='BatchExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Uri')]
+ [System.String]
+ # The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com.
+ # The region should match the region of the requested resources.
+ # For global resources, the region should be 'global'.
+ ${Endpoint},
+
+ [Parameter(ParameterSetName='BatchExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The subscription identifier for the resources in this batch.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='BatchViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter(Mandatory)]
+ [Alias('MetricName')]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(Required, PossibleTypes=([System.String]))]
+ [System.Collections.Generic.List[System.String]]
+ # The names of the metrics (comma separated) to retrieve.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [Alias('MetricNamespace')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # Metric namespace that contains the requested metric names.
+ ${Namespace},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The list of aggregation types (comma separated) to retrieve.
+ # *Examples: average, minimum, maximum*
+ ${Aggregation},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The end time of the query.
+ # It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ ${EndTime},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The filter is used to reduce the set of metric data returned.
+ # Example:
+ # Metric contains metadata A, B and C.
+ # - Return all time series of C where A = a1 and B = b1 or b2
+ # **filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
+ # - Invalid variant:
+ # **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
+ # This is invalid because the logical or operator cannot separate two different metadata names.
+ # - Return all time series where A = a1, B = b1 and C = c1:
+ # **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
+ # - Return all time series where A = a1
+ # **filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.
+ ${Filter},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The interval (i.e.
+ # timegrain) of the query in ISO 8601 duration format.
+ # Defaults to PT1M.
+ # Special case for 'FULL' value that returns single datapoint for entire time span requested.
+ # *Examples: PT15M, PT1H, P1D, FULL*
+ ${Interval},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The aggregation to use for sorting results and the direction of the sort.
+ # Only one order can be specified.
+ # *Examples: sum asc*
+ ${Orderby},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # Dimension name(s) to rollup results by.
+ # For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.
+ ${Rollupby},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.String]
+ # The start time of the query.
+ # It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ # If you have specified the endtime parameter, then this parameter is required.
+ # If only starttime is specified, then endtime defaults to the current time.
+ # If no time interval is specified, the default is 1 hour.
+ ${StartTime},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Query')]
+ [System.Int32]
+ # The maximum number of records to retrieve per resource ID in the request.
+ # Valid only if filter is specified.
+ # Defaults to 10.
+ ${Top},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Body')]
+ [System.String[]]
+ # The list of resource IDs to query metrics for.
+ ${ResourceId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ BatchExpanded = 'Az.Metric.private\Get-AzMetricsBatch_BatchExpanded';
+ BatchViaIdentityExpanded = 'Az.Metric.private\Get-AzMetricsBatch_BatchViaIdentityExpanded';
+ }
+ if (('BatchExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
+ }
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/Monitor/MetricsData.Autorest/exports/README.md b/src/Monitor/MetricsData.Autorest/exports/README.md
new file mode 100644
index 000000000000..6aa48dcaec47
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/exports/README.md
@@ -0,0 +1,20 @@
+# Exports
+This directory contains the cmdlets *exported by* `Az.Metric`. No other cmdlets in this repository are directly exported. What that means is the `Az.Metric` module will run [Export-ModuleMember](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation.
+
+## Info
+- Modifiable: no
+- Generated: all
+- Committed: no
+- Packaged: yes
+
+## Details
+The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`..\bin\Az.Metric.private.dll`) and from the `..\custom\Az.Metric.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](..\internal/README.md) in the `..\internal` folder.
+
+## Purpose
+We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles.
+
+## Structure
+The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile.
+
+## Usage
+When `./Az.Metric.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message.
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generate-help.ps1 b/src/Monitor/MetricsData.Autorest/generate-help.ps1
new file mode 100644
index 000000000000..0541160e8af0
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generate-help.ps1
@@ -0,0 +1,74 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(-not (Test-Path $exportsFolder)) {
+ Write-Error "Exports folder '$exportsFolder' was not found."
+}
+
+$directories = Get-ChildItem -Directory -Path $exportsFolder
+$hasProfiles = ($directories | Measure-Object).Count -gt 0
+if(-not $hasProfiles) {
+ $directories = Get-Item -Path $exportsFolder
+}
+
+$docsFolder = Join-Path $PSScriptRoot 'docs'
+if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+
+$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.Metric.psd1')
+$modulePath = $modulePsd1.FullName
+$moduleName = $modulePsd1.BaseName
+
+# Load DLL to use build-time cmdlets
+Import-Module -Name $modulePath
+Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.Metric.private.dll')
+$instance = [Microsoft.Azure.PowerShell.Cmdlets.Metric.Module]::Instance
+# Module info is shared per profile
+$moduleInfo = Get-Module -Name $moduleName
+
+foreach($directory in $directories)
+{
+ if($hasProfiles) {
+ Select-AzProfile -Name $directory.Name
+ }
+ # Reload module per profile
+ Import-Module -Name $modulePath -Force
+
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName
+ $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full }
+ $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo
+
+ $docsPath = Join-Path $docsFolder $directory.Name
+ $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue
+ $examplesPath = Join-Path $examplesFolder $directory.Name
+ $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
+ Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath -AddComplexInterfaceInfo:$addComplexInterfaceInfo
+ Write-Host -ForegroundColor Green "Created documentation in '$docsPath'"
+}
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generate-portal-ux.ps1 b/src/Monitor/MetricsData.Autorest/generate-portal-ux.ps1
new file mode 100644
index 000000000000..a32906dc3de1
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generate-portal-ux.ps1
@@ -0,0 +1,374 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+#
+# This Script will create a folder dedicated to Azure-specific content and includes metadata files essential for enhancing the user experience (UX) within the Azure portal.
+# These files are utilized by the Azure portal to effectively present the usage of cmdlets related to specific resources on portal pages.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+$moduleName = 'Az.Metric'
+$rootModuleName = 'Az.Monitor'
+if ($rootModuleName -eq "")
+{
+ $rootModuleName = $moduleName
+}
+$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot "./$moduleName.psd1")
+$modulePath = $modulePsd1.FullName
+
+# Load DLL to use build-time cmdlets
+Import-Module -Name $modulePath
+Import-Module -Name (Join-Path $PSScriptRoot "./bin/$moduleName.private.dll")
+$instance = [Microsoft.Azure.PowerShell.Cmdlets.Metric.Module]::Instance
+# Module info is shared per profile
+$moduleInfo = Get-Module -Name $moduleName
+$parameterSetsInfo = Get-Module -Name "$moduleName.private"
+
+function Test-FunctionSupported()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [string]
+ $FunctionName
+ )
+
+ If (-not $FunctionName.Contains("_")) {
+ return $false
+ }
+
+ $cmdletName, $parameterSetName = $FunctionName.Split("_")
+ If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity") -or $parameterSetName.Contains("ViaJson")) {
+ return $false
+ }
+ If ($cmdletName.StartsWith("New") -or $cmdletName.StartsWith("Set") -or $cmdletName.StartsWith("Update")) {
+ return $false
+ }
+
+ $parameterSetInfo = $parameterSetsInfo.ExportedCmdlets[$FunctionName]
+ foreach ($parameterInfo in $parameterSetInfo.Parameters.Values)
+ {
+ $category = (Get-ParameterAttribute -ParameterInfo $parameterInfo -AttributeName "CategoryAttribute").Categories
+ $invalideCategory = @('Query', 'Body')
+ if ($invalideCategory -contains $category)
+ {
+ return $false
+ }
+ }
+
+ $customFiles = Get-ChildItem -Path custom -Filter "$cmdletName.*"
+ if ($customFiles.Length -ne 0)
+ {
+ Write-Host -ForegroundColor Yellow "There are come custom files for $cmdletName, skip generate UX data for it."
+ return $false
+ }
+
+ return $true
+}
+
+function Get-MappedCmdletFromFunctionName()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [string]
+ $FunctionName
+ )
+
+ $cmdletName, $parameterSetName = $FunctionName.Split("_")
+
+ return $cmdletName
+}
+
+function Get-ParameterAttribute()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.ParameterMetadata]
+ $ParameterInfo,
+ [Parameter()]
+ [String]
+ $AttributeName
+ )
+ return $ParameterInfo.Attributes | Where-Object { $_.TypeId.Name -eq $AttributeName }
+}
+
+function Get-CmdletAttribute()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.CommandInfo]
+ $CmdletInfo,
+ [Parameter()]
+ [String]
+ $AttributeName
+ )
+
+ return $CmdletInfo.ImplementingType.GetTypeInfo().GetCustomAttributes([System.object], $true) | Where-Object { $_.TypeId.Name -eq $AttributeName }
+}
+
+function Get-CmdletDescription()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [String]
+ $CmdletName
+ )
+ $helpInfo = Get-Help $CmdletName -Full
+
+ $description = $helpInfo.Description.Text
+ if ($null -eq $description)
+ {
+ return ""
+ }
+ return $description
+}
+
+# Test whether the parameter is from swagger http path
+function Test-ParameterFromSwagger()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.ParameterMetadata]
+ $ParameterInfo
+ )
+ $category = (Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "CategoryAttribute").Categories
+ $doNotExport = Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "DoNotExportAttribute"
+ if ($null -ne $doNotExport)
+ {
+ return $false
+ }
+
+ $valideCategory = @('Path')
+ if ($valideCategory -contains $category)
+ {
+ return $true
+ }
+ return $false
+}
+
+function New-ExampleForParameterSet()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.CommandInfo]
+ $ParameterSetInfo
+ )
+ $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ }
+ $result = @()
+ foreach ($parameter in $parameters)
+ {
+ $category = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "CategoryAttribute").Categories
+ $sourceName = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "InfoAttribute").SerializedName
+ $name = $parameter.Name
+ $result += [ordered]@{
+ name = "-$Name"
+ value = "[$category.$sourceName]"
+ }
+ }
+
+ return $result
+}
+
+function New-ParameterArrayInParameterSet()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.CommandInfo]
+ $ParameterSetInfo
+ )
+ $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ }
+ $result = @()
+ foreach ($parameter in $parameters)
+ {
+ $isMandatory = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "ParameterAttribute").Mandatory
+ $parameterName = $parameter.Name
+ $parameterType = $parameter.ParameterType.ToString().Split('.')[1]
+ if ($parameter.SwitchParameter)
+ {
+ $parameterSignature = "-$parameterName"
+ }
+ else
+ {
+ $parameterSignature = "-$parameterName <$parameterType>"
+ }
+ if ($parameterName -eq "SubscriptionId")
+ {
+ $isMandatory = $false
+ }
+ if (-not $isMandatory)
+ {
+ $parameterSignature = "[$parameterSignature]"
+ }
+ $result += $parameterSignature
+ }
+
+ return $result
+}
+
+function New-MetadataForParameterSet()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.CommandInfo]
+ $ParameterSetInfo
+ )
+ $httpAttribute = Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "HttpPathAttribute"
+ $httpPath = $httpAttribute.Path
+ $apiVersion = $httpAttribute.ApiVersion
+ $provider = [System.Text.RegularExpressions.Regex]::New("/providers/([\w+\.]+)/").Match($httpPath).Groups[1].Value
+ $resourcePath = "/" + $httpPath.Split("$provider/")[1]
+ $resourceType = [System.Text.RegularExpressions.Regex]::New("/([\w]+)/\{\w+\}").Matches($resourcePath) | ForEach-Object {$_.groups[1].Value} | Join-String -Separator "/"
+ $cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name
+ $description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description
+ [object[]]$example = New-ExampleForParameterSet $ParameterSetInfo
+ [string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo
+
+ return @{
+ Path = $httpPath
+ Provider = $provider
+ ResourceType = $resourceType
+ ApiVersion = $apiVersion
+ CmdletName = $cmdletName
+ Description = $description
+ Example = $example
+ Signature = @{
+ parameters = $signature
+ }
+ }
+}
+
+function Merge-WithExistCmdletMetadata()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Collections.Specialized.OrderedDictionary]
+ $ExistedCmdletInfo,
+ [Parameter()]
+ [Hashtable]
+ $ParameterSetMetadata
+ )
+ $ExistedCmdletInfo.help.parameterSets += $ParameterSetMetadata.Signature
+ $ExistedCmdletInfo.examples += [ordered]@{
+ description = $ParameterSetMetadata.Description
+ parameters = $ParameterSetMetadata.Example
+ }
+
+ return $ExistedCmdletInfo
+}
+
+function New-MetadataForCmdlet()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [Hashtable]
+ $ParameterSetMetadata
+ )
+ $cmdletName = $ParameterSetMetadata.CmdletName
+ $description = Get-CmdletDescription $cmdletName
+ $result = [ordered]@{
+ name = $cmdletName
+ description = $description
+ path = $ParameterSetMetadata.Path
+ help = [ordered]@{
+ learnMore = [ordered]@{
+ url = "https://learn.microsoft.com/powershell/module/$rootModuleName/$cmdletName".ToLower()
+ }
+ parameterSets = @()
+ }
+ examples = @()
+ }
+ $result = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $result -ParameterSetMetadata $ParameterSetMetadata
+ return $result
+}
+
+$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-FunctionSupported($_) }
+$resourceTypes = @{}
+foreach ($parameterSetName in $parameterSets)
+{
+ $cmdletInfo = $parameterSetsInfo.ExportedCommands[$parameterSetName]
+ $parameterSetMetadata = New-MetadataForParameterSet -ParameterSetInfo $cmdletInfo
+ $cmdletName = $parameterSetMetadata.CmdletName
+ if (-not ($moduleInfo.ExportedCommands.ContainsKey($cmdletName)))
+ {
+ continue
+ }
+ if ($resourceTypes.ContainsKey($parameterSetMetadata.ResourceType))
+ {
+ $ExistedCmdletInfo = $resourceTypes[$parameterSetMetadata.ResourceType].commands | Where-Object { $_.name -eq $cmdletName }
+ if ($ExistedCmdletInfo)
+ {
+ $ExistedCmdletInfo = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $ExistedCmdletInfo -ParameterSetMetadata $parameterSetMetadata
+ }
+ else
+ {
+ $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata
+ $resourceTypes[$parameterSetMetadata.ResourceType].commands += $cmdletInfo
+ }
+ }
+ else
+ {
+ $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata
+ $resourceTypes[$parameterSetMetadata.ResourceType] = [ordered]@{
+ resourceType = $parameterSetMetadata.ResourceType
+ apiVersion = $parameterSetMetadata.ApiVersion
+ learnMore = @{
+ url = "https://learn.microsoft.com/powershell/module/$rootModuleName".ToLower()
+ }
+ commands = @($cmdletInfo)
+ provider = $parameterSetMetadata.Provider
+ }
+ }
+}
+
+$UXFolder = 'UX'
+if (Test-Path $UXFolder)
+{
+ Remove-Item -Path $UXFolder -Recurse
+}
+$null = New-Item -ItemType Directory -Path $UXFolder
+
+foreach ($resourceType in $resourceTypes.Keys)
+{
+ $resourceTypeFileName = $resourceType -replace "/", "-"
+ if ($resourceTypeFileName -eq "")
+ {
+ continue
+ }
+ $resourceTypeInfo = $resourceTypes[$resourceType]
+ $provider = $resourceTypeInfo.provider
+ $providerFolder = "$UXFolder/$provider"
+ if (-not (Test-Path $providerFolder))
+ {
+ $null = New-Item -ItemType Directory -Path $providerFolder
+ }
+ $resourceTypeInfo.Remove("provider")
+ $resourceTypeInfo | ConvertTo-Json -Depth 10 | Out-File "$providerFolder/$resourceTypeFileName.json"
+}
diff --git a/src/Monitor/MetricsData.Autorest/generated/Module.cs b/src/Monitor/MetricsData.Autorest/generated/Module.cs
new file mode 100644
index 000000000000..2faea816bd4d
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/Module.cs
@@ -0,0 +1,194 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+ using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+ using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>;
+ using GetParameterDelegate = global::System.Func;
+ using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using ArgumentCompleterDelegate = global::System.Func;
+ using GetTelemetryIdDelegate = global::System.Func;
+ using TelemetryDelegate = global::System.Action;
+ using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>;
+ using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>;
+ using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+
+ /// A class that contains the module-common code and data.
+ public partial class Module
+ {
+ /// The currently selected profile.
+ public string Profile = global::System.String.Empty;
+
+ public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler();
+
+ private static bool _init = false;
+
+ private static readonly global::System.Object _initLock = new global::System.Object();
+
+ private static Microsoft.Azure.PowerShell.Cmdlets.Metric.Module _instance;
+
+ /// the ISendAsync pipeline instance
+ private Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpPipeline _pipeline;
+
+ /// the ISendAsync pipeline instance (when proxy is enabled)
+ private Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpPipeline _pipelineWithProxy;
+
+ private static readonly global::System.Object _singletonLock = new global::System.Object();
+
+ public bool _useProxy = false;
+
+ public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy();
+
+ /// Gets completion data for azure specific fields
+ public ArgumentCompleterDelegate ArgumentCompleter { get; set; }
+
+ /// The instance of the Client API
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Metric ClientAPI { get; set; }
+
+ /// A delegate that gets called for each signalled event
+ public EventListenerDelegate EventListener { get; set; }
+
+ /// The delegate to call to get parameter data from a common module.
+ public GetParameterDelegate GetParameterValue { get; set; }
+
+ /// The delegate to get the telemetry Id.
+ public GetTelemetryIdDelegate GetTelemetryId { get; set; }
+
+ /// the singleton of this module class
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } }
+
+ /// The Name of this module
+ public string Name => @"Az.Metric";
+
+ /// The delegate to call when this module is loaded (supporting a commmon module).
+ public ModuleLoadPipelineDelegate OnModuleLoad { get; set; }
+
+ /// The delegate to call before each new request (supporting a commmon module).
+ public NewRequestPipelineDelegate OnNewRequest { get; set; }
+
+ /// The name of the currently selected Azure profile
+ public global::System.String ProfileName { get; set; }
+
+ /// The ResourceID for this module (azure arm).
+ public string ResourceId => @"Az.Metric";
+
+ /// The delegate for creating a telemetry.
+ public TelemetryDelegate Telemetry { get; set; }
+
+ /// The from the cmdlet
+ /// The HttpPipeline for the request
+
+ partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpPipeline pipeline);
+
+ /// The from the cmdlet
+ /// The HttpPipeline for the request
+
+ partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpPipeline pipeline);
+
+ partial void CustomInit();
+
+ /// Creates an instance of the HttpPipeline for each call.
+ /// The from the cmdlet
+ /// the cmdlet's correlation id.
+ /// the cmdlet's process record correlation id.
+ /// the cmdlet's parameterset name.
+ /// a dict for extensible parameters
+ /// An instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpPipeline for the remote call.
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null, global::System.Collections.Generic.IDictionary extensibleParameters = null)
+ {
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpPipeline pipeline = null;
+ BeforeCreatePipeline(invocationInfo, ref pipeline);
+ pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone();
+ AfterCreatePipeline(invocationInfo, ref pipeline);
+ pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync);
+ OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } );
+ return pipeline;
+ }
+
+ /// Gets parameters from a common module.
+ /// The from the cmdlet
+ /// the cmdlet's correlation id.
+ /// The name of the parameter to get the value for.
+ ///
+ /// The parameter value from the common module. (Note: this should be type converted on the way back)
+ ///
+ public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName );
+
+ /// Initialization steps performed after the module is loaded.
+ public void Init()
+ {
+ if (_init == false)
+ {
+ lock (_initLock) {
+ if (_init == false) {
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } );
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } );
+ CustomInit();
+ _init = true;
+ }
+ }
+ }
+ }
+
+ /// Creates the module instance.
+ private Module()
+ {
+ // constructor
+ ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Metric();
+ _handler.Proxy = _webProxy;
+ _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient()));
+ _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler)));
+ }
+
+ /// The HTTP Proxy to use.
+ /// The HTTP Proxy Credentials
+ /// True if the proxy should use default credentials
+ public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials)
+ {
+ _useProxy = proxy != null;
+ if (proxy == null)
+ {
+ return;
+ }
+ // set the proxy configuration
+ _webProxy.Address = proxy;
+ _webProxy.BypassProxyOnLocal = false;
+ if (proxyUseDefaultCredentials)
+ {
+ _webProxy.Credentials = null;
+ _webProxy.UseDefaultCredentials = true;
+ }
+ else
+ {
+ _webProxy.UseDefaultCredentials = false;
+ _webProxy.Credentials = proxyCredential ?.GetNetworkCredential();
+ }
+ }
+
+ /// Called to dispatch events to the common module listener
+ /// The ID of the event
+ /// The cancellation token for the event
+ /// A delegate to get the detailed event data
+ /// The callback for the event dispatcher
+ /// The from the cmdlet
+ /// the cmdlet's parameterset name.
+ /// the cmdlet's correlation id.
+ /// the cmdlet's process record correlation id.
+ /// the exception that is being thrown (if available)
+ ///
+ /// A that will be complete when handling of the event is completed.
+ ///
+ public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception)
+ {
+ using( NoSynchronizationContext )
+ {
+ await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Metric.cs b/src/Monitor/MetricsData.Autorest/generated/api/Metric.cs
new file mode 100644
index 000000000000..93c2a08234d3
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Metric.cs
@@ -0,0 +1,757 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ ///
+ /// Low-level API implementation for the Metric service.
+ ///
+ public partial class Metric
+ {
+
+ /// Lists the metric values for multiple resources.
+ /// The subscription identifier for the resources in this batch.
+ /// The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have
+ /// specified the endtime parameter, then this parameter is required.
+ /// If only starttime is specified, then endtime defaults to the current time.
+ /// If no time interval is specified, the default is 1 hour.
+ /// The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ /// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special
+ /// case for 'FULL' value that returns single datapoint for entire time span requested.
+ /// *Examples: PT15M, PT1H, P1D, FULL*
+ /// Metric namespace that contains the requested metric names.
+ /// The names of the metrics (comma separated) to retrieve.
+ /// The list of aggregation types (comma separated) to retrieve.
+ /// *Examples: average, minimum, maximum*
+ /// The maximum number of records to retrieve per resource ID in the request.
+ /// Valid only if filter is specified.
+ /// Defaults to 10.
+ /// The aggregation to use for sorting results and the direction of the sort.
+ /// Only one order can be specified.
+ /// *Examples: sum asc*
+ /// The filter is used to reduce the set of metric data returned. Example: Metric contains metadata
+ /// A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq
+ /// ‘b2’ and C eq ‘*’** - Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid
+ /// because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1,
+ /// B = b1 and C = c1: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A
+ /// eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.
+ /// Dimension name(s) to rollup results by. For example if you only want to see metric values with
+ /// a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify
+ /// 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.
+ /// The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region
+ /// should match the region of the requested resources. For global resources, the region should be 'global'.
+ /// Metrics batch body including the list of resource ids
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task MetricsBatch(string subscriptionId, string starttime, string endtime, string interval, string metricnamespace, System.Collections.Generic.List metricnames, string aggregation, int? top, string orderby, string filter, string rollupby, string endpoint, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-10-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/metrics:getBatch"
+ + "?"
+ + (string.IsNullOrEmpty(starttime) ? global::System.String.Empty : "starttime=" + global::System.Uri.EscapeDataString(starttime))
+ + "&"
+ + (string.IsNullOrEmpty(endtime) ? global::System.String.Empty : "endtime=" + global::System.Uri.EscapeDataString(endtime))
+ + "&"
+ + (string.IsNullOrEmpty(interval) ? global::System.String.Empty : "interval=" + global::System.Uri.EscapeDataString(interval))
+ + "&"
+ + "metricnamespace=" + global::System.Uri.EscapeDataString(metricnamespace)
+ + "&"
+ + (null != metricnames && metricnames.Count > 0 ? "metricnames=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(metricnames, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty)
+ + "&"
+ + (string.IsNullOrEmpty(aggregation) ? global::System.String.Empty : "aggregation=" + global::System.Uri.EscapeDataString(aggregation))
+ + "&"
+ + (null == top ? global::System.String.Empty : "top=" + global::System.Uri.EscapeDataString(top.ToString()))
+ + "&"
+ + (string.IsNullOrEmpty(orderby) ? global::System.String.Empty : "orderby=" + global::System.Uri.EscapeDataString(orderby))
+ + "&"
+ + (string.IsNullOrEmpty(filter) ? global::System.String.Empty : "filter=" + global::System.Uri.EscapeDataString(filter))
+ + "&"
+ + (string.IsNullOrEmpty(rollupby) ? global::System.String.Empty : "rollupby=" + global::System.Uri.EscapeDataString(rollupby))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"{endpoint}{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.MetricsBatch_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Lists the metric values for multiple resources.
+ ///
+ /// The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have
+ /// specified the endtime parameter, then this parameter is required.
+ /// If only starttime is specified, then endtime defaults to the current time.
+ /// If no time interval is specified, the default is 1 hour.
+ /// The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ /// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special
+ /// case for 'FULL' value that returns single datapoint for entire time span requested.
+ /// *Examples: PT15M, PT1H, P1D, FULL*
+ /// Metric namespace that contains the requested metric names.
+ /// The names of the metrics (comma separated) to retrieve.
+ /// The list of aggregation types (comma separated) to retrieve.
+ /// *Examples: average, minimum, maximum*
+ /// The maximum number of records to retrieve per resource ID in the request.
+ /// Valid only if filter is specified.
+ /// Defaults to 10.
+ /// The aggregation to use for sorting results and the direction of the sort.
+ /// Only one order can be specified.
+ /// *Examples: sum asc*
+ /// The filter is used to reduce the set of metric data returned. Example: Metric contains metadata
+ /// A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq
+ /// ‘b2’ and C eq ‘*’** - Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid
+ /// because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1,
+ /// B = b1 and C = c1: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A
+ /// eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.
+ /// Dimension name(s) to rollup results by. For example if you only want to see metric values with
+ /// a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify
+ /// 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.
+ /// The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region
+ /// should match the region of the requested resources. For global resources, the region should be 'global'.
+ /// Metrics batch body including the list of resource ids
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task MetricsBatchViaIdentity(global::System.String viaIdentity, string starttime, string endtime, string interval, string metricnamespace, System.Collections.Generic.List metricnames, string aggregation, int? top, string orderby, string filter, string rollupby, string endpoint, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-10-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}'");
+ }
+
+ // 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
+ + "/metrics:getBatch"
+ + "?"
+ + (string.IsNullOrEmpty(starttime) ? global::System.String.Empty : "starttime=" + global::System.Uri.EscapeDataString(starttime))
+ + "&"
+ + (string.IsNullOrEmpty(endtime) ? global::System.String.Empty : "endtime=" + global::System.Uri.EscapeDataString(endtime))
+ + "&"
+ + (string.IsNullOrEmpty(interval) ? global::System.String.Empty : "interval=" + global::System.Uri.EscapeDataString(interval))
+ + "&"
+ + "metricnamespace=" + global::System.Uri.EscapeDataString(metricnamespace)
+ + "&"
+ + (null != metricnames && metricnames.Count > 0 ? "metricnames=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(metricnames, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty)
+ + "&"
+ + (string.IsNullOrEmpty(aggregation) ? global::System.String.Empty : "aggregation=" + global::System.Uri.EscapeDataString(aggregation))
+ + "&"
+ + (null == top ? global::System.String.Empty : "top=" + global::System.Uri.EscapeDataString(top.ToString()))
+ + "&"
+ + (string.IsNullOrEmpty(orderby) ? global::System.String.Empty : "orderby=" + global::System.Uri.EscapeDataString(orderby))
+ + "&"
+ + (string.IsNullOrEmpty(filter) ? global::System.String.Empty : "filter=" + global::System.Uri.EscapeDataString(filter))
+ + "&"
+ + (string.IsNullOrEmpty(rollupby) ? global::System.String.Empty : "rollupby=" + global::System.Uri.EscapeDataString(rollupby))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"{endpoint}{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.MetricsBatch_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Lists the metric values for multiple resources.
+ ///
+ /// The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have
+ /// specified the endtime parameter, then this parameter is required.
+ /// If only starttime is specified, then endtime defaults to the current time.
+ /// If no time interval is specified, the default is 1 hour.
+ /// The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ /// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special
+ /// case for 'FULL' value that returns single datapoint for entire time span requested.
+ /// *Examples: PT15M, PT1H, P1D, FULL*
+ /// Metric namespace that contains the requested metric names.
+ /// The names of the metrics (comma separated) to retrieve.
+ /// The list of aggregation types (comma separated) to retrieve.
+ /// *Examples: average, minimum, maximum*
+ /// The maximum number of records to retrieve per resource ID in the request.
+ /// Valid only if filter is specified.
+ /// Defaults to 10.
+ /// The aggregation to use for sorting results and the direction of the sort.
+ /// Only one order can be specified.
+ /// *Examples: sum asc*
+ /// The filter is used to reduce the set of metric data returned. Example: Metric contains metadata
+ /// A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq
+ /// ‘b2’ and C eq ‘*’** - Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid
+ /// because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1,
+ /// B = b1 and C = c1: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A
+ /// eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.
+ /// Dimension name(s) to rollup results by. For example if you only want to see metric values with
+ /// a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify
+ /// 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.
+ /// The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region
+ /// should match the region of the requested resources. For global resources, the region should be 'global'.
+ /// Metrics batch body including the list of resource ids
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task MetricsBatchViaIdentityWithResult(global::System.String viaIdentity, string starttime, string endtime, string interval, string metricnamespace, System.Collections.Generic.List metricnames, string aggregation, int? top, string orderby, string filter, string rollupby, string endpoint, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList body, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-10-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}'");
+ }
+
+ // 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
+ + "/metrics:getBatch"
+ + "?"
+ + (string.IsNullOrEmpty(starttime) ? global::System.String.Empty : "starttime=" + global::System.Uri.EscapeDataString(starttime))
+ + "&"
+ + (string.IsNullOrEmpty(endtime) ? global::System.String.Empty : "endtime=" + global::System.Uri.EscapeDataString(endtime))
+ + "&"
+ + (string.IsNullOrEmpty(interval) ? global::System.String.Empty : "interval=" + global::System.Uri.EscapeDataString(interval))
+ + "&"
+ + "metricnamespace=" + global::System.Uri.EscapeDataString(metricnamespace)
+ + "&"
+ + (null != metricnames && metricnames.Count > 0 ? "metricnames=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(metricnames, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty)
+ + "&"
+ + (string.IsNullOrEmpty(aggregation) ? global::System.String.Empty : "aggregation=" + global::System.Uri.EscapeDataString(aggregation))
+ + "&"
+ + (null == top ? global::System.String.Empty : "top=" + global::System.Uri.EscapeDataString(top.ToString()))
+ + "&"
+ + (string.IsNullOrEmpty(orderby) ? global::System.String.Empty : "orderby=" + global::System.Uri.EscapeDataString(orderby))
+ + "&"
+ + (string.IsNullOrEmpty(filter) ? global::System.String.Empty : "filter=" + global::System.Uri.EscapeDataString(filter))
+ + "&"
+ + (string.IsNullOrEmpty(rollupby) ? global::System.String.Empty : "rollupby=" + global::System.Uri.EscapeDataString(rollupby))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"{endpoint}{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.MetricsBatchWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Lists the metric values for multiple resources.
+ /// The subscription identifier for the resources in this batch.
+ /// The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have
+ /// specified the endtime parameter, then this parameter is required.
+ /// If only starttime is specified, then endtime defaults to the current time.
+ /// If no time interval is specified, the default is 1 hour.
+ /// The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ /// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special
+ /// case for 'FULL' value that returns single datapoint for entire time span requested.
+ /// *Examples: PT15M, PT1H, P1D, FULL*
+ /// Metric namespace that contains the requested metric names.
+ /// The names of the metrics (comma separated) to retrieve.
+ /// The list of aggregation types (comma separated) to retrieve.
+ /// *Examples: average, minimum, maximum*
+ /// The maximum number of records to retrieve per resource ID in the request.
+ /// Valid only if filter is specified.
+ /// Defaults to 10.
+ /// The aggregation to use for sorting results and the direction of the sort.
+ /// Only one order can be specified.
+ /// *Examples: sum asc*
+ /// The filter is used to reduce the set of metric data returned. Example: Metric contains metadata
+ /// A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq
+ /// ‘b2’ and C eq ‘*’** - Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid
+ /// because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1,
+ /// B = b1 and C = c1: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A
+ /// eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.
+ /// Dimension name(s) to rollup results by. For example if you only want to see metric values with
+ /// a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify
+ /// 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.
+ /// The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region
+ /// should match the region of the requested resources. For global resources, the region should be 'global'.
+ /// Json string supplied to the MetricsBatch 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.Metric.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task MetricsBatchViaJsonString(string subscriptionId, string starttime, string endtime, string interval, string metricnamespace, System.Collections.Generic.List metricnames, string aggregation, int? top, string orderby, string filter, string rollupby, string endpoint, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-10-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/metrics:getBatch"
+ + "?"
+ + (string.IsNullOrEmpty(starttime) ? global::System.String.Empty : "starttime=" + global::System.Uri.EscapeDataString(starttime))
+ + "&"
+ + (string.IsNullOrEmpty(endtime) ? global::System.String.Empty : "endtime=" + global::System.Uri.EscapeDataString(endtime))
+ + "&"
+ + (string.IsNullOrEmpty(interval) ? global::System.String.Empty : "interval=" + global::System.Uri.EscapeDataString(interval))
+ + "&"
+ + "metricnamespace=" + global::System.Uri.EscapeDataString(metricnamespace)
+ + "&"
+ + (null != metricnames && metricnames.Count > 0 ? "metricnames=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(metricnames, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty)
+ + "&"
+ + (string.IsNullOrEmpty(aggregation) ? global::System.String.Empty : "aggregation=" + global::System.Uri.EscapeDataString(aggregation))
+ + "&"
+ + (null == top ? global::System.String.Empty : "top=" + global::System.Uri.EscapeDataString(top.ToString()))
+ + "&"
+ + (string.IsNullOrEmpty(orderby) ? global::System.String.Empty : "orderby=" + global::System.Uri.EscapeDataString(orderby))
+ + "&"
+ + (string.IsNullOrEmpty(filter) ? global::System.String.Empty : "filter=" + global::System.Uri.EscapeDataString(filter))
+ + "&"
+ + (string.IsNullOrEmpty(rollupby) ? global::System.String.Empty : "rollupby=" + global::System.Uri.EscapeDataString(rollupby))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"{endpoint}{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.MetricsBatch_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Lists the metric values for multiple resources.
+ /// The subscription identifier for the resources in this batch.
+ /// The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have
+ /// specified the endtime parameter, then this parameter is required.
+ /// If only starttime is specified, then endtime defaults to the current time.
+ /// If no time interval is specified, the default is 1 hour.
+ /// The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ /// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special
+ /// case for 'FULL' value that returns single datapoint for entire time span requested.
+ /// *Examples: PT15M, PT1H, P1D, FULL*
+ /// Metric namespace that contains the requested metric names.
+ /// The names of the metrics (comma separated) to retrieve.
+ /// The list of aggregation types (comma separated) to retrieve.
+ /// *Examples: average, minimum, maximum*
+ /// The maximum number of records to retrieve per resource ID in the request.
+ /// Valid only if filter is specified.
+ /// Defaults to 10.
+ /// The aggregation to use for sorting results and the direction of the sort.
+ /// Only one order can be specified.
+ /// *Examples: sum asc*
+ /// The filter is used to reduce the set of metric data returned. Example: Metric contains metadata
+ /// A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq
+ /// ‘b2’ and C eq ‘*’** - Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid
+ /// because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1,
+ /// B = b1 and C = c1: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A
+ /// eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.
+ /// Dimension name(s) to rollup results by. For example if you only want to see metric values with
+ /// a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify
+ /// 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.
+ /// The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region
+ /// should match the region of the requested resources. For global resources, the region should be 'global'.
+ /// Json string supplied to the MetricsBatch operation
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task MetricsBatchViaJsonStringWithResult(string subscriptionId, string starttime, string endtime, string interval, string metricnamespace, System.Collections.Generic.List metricnames, string aggregation, int? top, string orderby, string filter, string rollupby, string endpoint, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-10-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/metrics:getBatch"
+ + "?"
+ + (string.IsNullOrEmpty(starttime) ? global::System.String.Empty : "starttime=" + global::System.Uri.EscapeDataString(starttime))
+ + "&"
+ + (string.IsNullOrEmpty(endtime) ? global::System.String.Empty : "endtime=" + global::System.Uri.EscapeDataString(endtime))
+ + "&"
+ + (string.IsNullOrEmpty(interval) ? global::System.String.Empty : "interval=" + global::System.Uri.EscapeDataString(interval))
+ + "&"
+ + "metricnamespace=" + global::System.Uri.EscapeDataString(metricnamespace)
+ + "&"
+ + (null != metricnames && metricnames.Count > 0 ? "metricnames=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(metricnames, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty)
+ + "&"
+ + (string.IsNullOrEmpty(aggregation) ? global::System.String.Empty : "aggregation=" + global::System.Uri.EscapeDataString(aggregation))
+ + "&"
+ + (null == top ? global::System.String.Empty : "top=" + global::System.Uri.EscapeDataString(top.ToString()))
+ + "&"
+ + (string.IsNullOrEmpty(orderby) ? global::System.String.Empty : "orderby=" + global::System.Uri.EscapeDataString(orderby))
+ + "&"
+ + (string.IsNullOrEmpty(filter) ? global::System.String.Empty : "filter=" + global::System.Uri.EscapeDataString(filter))
+ + "&"
+ + (string.IsNullOrEmpty(rollupby) ? global::System.String.Empty : "rollupby=" + global::System.Uri.EscapeDataString(rollupby))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"{endpoint}{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.MetricsBatchWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Lists the metric values for multiple resources.
+ /// The subscription identifier for the resources in this batch.
+ /// The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have
+ /// specified the endtime parameter, then this parameter is required.
+ /// If only starttime is specified, then endtime defaults to the current time.
+ /// If no time interval is specified, the default is 1 hour.
+ /// The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ /// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special
+ /// case for 'FULL' value that returns single datapoint for entire time span requested.
+ /// *Examples: PT15M, PT1H, P1D, FULL*
+ /// Metric namespace that contains the requested metric names.
+ /// The names of the metrics (comma separated) to retrieve.
+ /// The list of aggregation types (comma separated) to retrieve.
+ /// *Examples: average, minimum, maximum*
+ /// The maximum number of records to retrieve per resource ID in the request.
+ /// Valid only if filter is specified.
+ /// Defaults to 10.
+ /// The aggregation to use for sorting results and the direction of the sort.
+ /// Only one order can be specified.
+ /// *Examples: sum asc*
+ /// The filter is used to reduce the set of metric data returned. Example: Metric contains metadata
+ /// A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq
+ /// ‘b2’ and C eq ‘*’** - Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid
+ /// because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1,
+ /// B = b1 and C = c1: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A
+ /// eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.
+ /// Dimension name(s) to rollup results by. For example if you only want to see metric values with
+ /// a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify
+ /// 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.
+ /// The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region
+ /// should match the region of the requested resources. For global resources, the region should be 'global'.
+ /// Metrics batch body including the list of resource ids
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task MetricsBatchWithResult(string subscriptionId, string starttime, string endtime, string interval, string metricnamespace, System.Collections.Generic.List metricnames, string aggregation, int? top, string orderby, string filter, string rollupby, string endpoint, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList body, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-10-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/metrics:getBatch"
+ + "?"
+ + (string.IsNullOrEmpty(starttime) ? global::System.String.Empty : "starttime=" + global::System.Uri.EscapeDataString(starttime))
+ + "&"
+ + (string.IsNullOrEmpty(endtime) ? global::System.String.Empty : "endtime=" + global::System.Uri.EscapeDataString(endtime))
+ + "&"
+ + (string.IsNullOrEmpty(interval) ? global::System.String.Empty : "interval=" + global::System.Uri.EscapeDataString(interval))
+ + "&"
+ + "metricnamespace=" + global::System.Uri.EscapeDataString(metricnamespace)
+ + "&"
+ + (null != metricnames && metricnames.Count > 0 ? "metricnames=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(metricnames, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty)
+ + "&"
+ + (string.IsNullOrEmpty(aggregation) ? global::System.String.Empty : "aggregation=" + global::System.Uri.EscapeDataString(aggregation))
+ + "&"
+ + (null == top ? global::System.String.Empty : "top=" + global::System.Uri.EscapeDataString(top.ToString()))
+ + "&"
+ + (string.IsNullOrEmpty(orderby) ? global::System.String.Empty : "orderby=" + global::System.Uri.EscapeDataString(orderby))
+ + "&"
+ + (string.IsNullOrEmpty(filter) ? global::System.String.Empty : "filter=" + global::System.Uri.EscapeDataString(filter))
+ + "&"
+ + (string.IsNullOrEmpty(rollupby) ? global::System.String.Empty : "rollupby=" + global::System.Uri.EscapeDataString(rollupby))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"{endpoint}{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.MetricsBatchWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task MetricsBatchWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricResultsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(body.Result)) );
+ // Error Response : default
+ var code = (await _result)?.Code;
+ var message = (await _result)?.Message;
+ if ((null == code || null == message))
+ {
+ // Unrecognized Response. Create an error record based on what we have.
+ var ex = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.RestException(_response, await _result);
+ throw ex;
+ }
+ else
+ {
+ throw new global::System.Exception($"[{code}] : {message}");
+ }
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task MetricsBatch_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricResultsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// The subscription identifier for the resources in this batch.
+ /// The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region
+ /// should match the region of the requested resources. For global resources, the region should be 'global'.
+ /// The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have
+ /// specified the endtime parameter, then this parameter is required.
+ /// If only starttime is specified, then endtime defaults to the current time.
+ /// If no time interval is specified, the default is 1 hour.
+ /// The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ /// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special
+ /// case for 'FULL' value that returns single datapoint for entire time span requested.
+ /// *Examples: PT15M, PT1H, P1D, FULL*
+ /// Metric namespace that contains the requested metric names.
+ /// The names of the metrics (comma separated) to retrieve.
+ /// The list of aggregation types (comma separated) to retrieve.
+ /// *Examples: average, minimum, maximum*
+ /// The maximum number of records to retrieve per resource ID in the request.
+ /// Valid only if filter is specified.
+ /// Defaults to 10.
+ /// The aggregation to use for sorting results and the direction of the sort.
+ /// Only one order can be specified.
+ /// *Examples: sum asc*
+ /// The filter is used to reduce the set of metric data returned. Example: Metric contains metadata
+ /// A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq
+ /// ‘b2’ and C eq ‘*’** - Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid
+ /// because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1,
+ /// B = b1 and C = c1: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A
+ /// eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.
+ /// Dimension name(s) to rollup results by. For example if you only want to see metric values with
+ /// a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify
+ /// 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.
+ /// Metrics batch body including the list of resource ids
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task MetricsBatch_Validate(string subscriptionId, string endpoint, string starttime, string endtime, string interval, string metricnamespace, System.Collections.Generic.List metricnames, string aggregation, int? top, string orderby, string filter, string rollupby, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList body, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$");
+ await eventListener.AssertNotNull(nameof(endpoint),endpoint);
+ await eventListener.AssertRegEx(nameof(endpoint),endpoint,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$");
+ await eventListener.AssertNotNull(nameof(starttime),starttime);
+ await eventListener.AssertNotNull(nameof(endtime),endtime);
+ await eventListener.AssertNotNull(nameof(interval),interval);
+ await eventListener.AssertNotNull(nameof(metricnamespace),metricnamespace);
+ await eventListener.AssertNotNull(nameof(metricnames), metricnames);
+ await eventListener.AssertNotNull(nameof(aggregation),aggregation);
+ await eventListener.AssertNotNull(nameof(orderby),orderby);
+ await eventListener.AssertNotNull(nameof(filter),filter);
+ await eventListener.AssertNotNull(nameof(rollupby),rollupby);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/Any.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/Any.PowerShell.cs
new file mode 100644
index 000000000000..cb6c32812774
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/Any.PowerShell.cs
@@ -0,0 +1,156 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ /// Anything
+ [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))]
+ public partial class Any
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal Any(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal Any(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new Any(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new Any(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// Anything
+ [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))]
+ public partial interface IAny
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/Any.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/Any.TypeConverter.cs
new file mode 100644
index 000000000000..7fb3ceba7860
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/Any.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class AnyTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return Any.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return Any.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return Any.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/Any.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/Any.cs
new file mode 100644
index 000000000000..ad7965d6f27a
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// Anything
+ public partial class Any :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAnyInternal
+ {
+
+ /// Creates an new instance.
+ public Any()
+ {
+
+ }
+ }
+ /// Anything
+ public partial interface IAny :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IJsonSerializable
+ {
+
+ }
+ /// Anything
+ internal partial interface IAnyInternal
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/Any.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/Any.json.cs
new file mode 100644
index 000000000000..ad56dde32d23
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// Anything
+ 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.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal Any(Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Models.IAny.
+ ///
+ /// a to deserialize from.
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.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/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs
new file mode 100644
index 000000000000..721291c66ca2
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.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.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ /// The resource management error additional info.
+ [System.ComponentModel.TypeConverter(typeof(ErrorAdditionalInfoTypeConverter))]
+ public partial class ErrorAdditionalInfo
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new ErrorAdditionalInfo(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new ErrorAdditionalInfo(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal ErrorAdditionalInfo(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Type"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString);
+ }
+ if (content.Contains("Info"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.AnyTypeConverter.ConvertFrom);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Type"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString);
+ }
+ if (content.Contains("Info"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.AnyTypeConverter.ConvertFrom);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// The resource management error additional info.
+ [System.ComponentModel.TypeConverter(typeof(ErrorAdditionalInfoTypeConverter))]
+ public partial interface IErrorAdditionalInfo
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs
new file mode 100644
index 000000000000..eaef54056d6c
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class ErrorAdditionalInfoTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return ErrorAdditionalInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return ErrorAdditionalInfo.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return ErrorAdditionalInfo.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorAdditionalInfo.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorAdditionalInfo.cs
new file mode 100644
index 000000000000..14aff86a9d3a
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorAdditionalInfo.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// The resource management error additional info.
+ public partial class ErrorAdditionalInfo :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfoInternal
+ {
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny _info;
+
+ /// The additional info.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.Any()); }
+
+ /// Internal Acessors for Info
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.Any()); set { {_info = value;} } }
+
+ /// Internal Acessors for Type
+ string Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } }
+
+ /// Backing field for property.
+ private string _type;
+
+ /// The additional info type.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.IJsonSerializable
+ {
+ /// The additional info.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ Description = @"The additional info.",
+ SerializedName = @"info",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny) })]
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IAny Info { get; }
+ /// The additional info type.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ 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.Metric.Models.IAny Info { get; set; }
+ /// The additional info type.
+ string Type { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs
new file mode 100644
index 000000000000..9b3f8b01c5d8
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal ErrorAdditionalInfo(Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Models.Any.FromJson(__jsonInfo) : _info;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeRead))
+ {
+ AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeRead))
+ {
+ AddIf( null != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.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/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs
new file mode 100644
index 000000000000..2599732901a6
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs
@@ -0,0 +1,196 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ /// The error detail.
+ [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))]
+ public partial class ErrorDetail
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new ErrorDetail(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new ErrorDetail(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal ErrorDetail(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Code"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString);
+ }
+ if (content.Contains("Message"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString);
+ }
+ if (content.Contains("Target"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString);
+ }
+ if (content.Contains("Detail"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorDetailTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("AdditionalInfo"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal ErrorDetail(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Code"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString);
+ }
+ if (content.Contains("Message"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString);
+ }
+ if (content.Contains("Target"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString);
+ }
+ if (content.Contains("Detail"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorDetailTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("AdditionalInfo"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// The error detail.
+ [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))]
+ public partial interface IErrorDetail
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs
new file mode 100644
index 000000000000..d2ec234f91b9
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class ErrorDetailTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return ErrorDetail.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return ErrorDetail.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return ErrorDetail.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.cs
new file mode 100644
index 000000000000..4f60f0ec978f
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// The error detail.
+ public partial class ErrorDetail :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal
+ {
+
+ /// Backing field for property.
+ private System.Collections.Generic.List _additionalInfo;
+
+ /// The error additional info.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public System.Collections.Generic.List AdditionalInfo { get => this._additionalInfo; }
+
+ /// Backing field for property.
+ private string _code;
+
+ /// The error code.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Code { get => this._code; }
+
+ /// Backing field for property.
+ private System.Collections.Generic.List _detail;
+
+ /// The error details.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public System.Collections.Generic.List Detail { get => this._detail; }
+
+ /// Backing field for property.
+ private string _message;
+
+ /// The error message.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Message { get => this._message; }
+
+ /// Internal Acessors for AdditionalInfo
+ System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } }
+
+ /// Internal Acessors for Code
+ string Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } }
+
+ /// Internal Acessors for Detail
+ System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } }
+
+ /// Internal Acessors for Message
+ string Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } }
+
+ /// Internal Acessors for Target
+ string Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } }
+
+ /// Backing field for property.
+ private string _target;
+
+ /// The error target.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.IJsonSerializable
+ {
+ /// The error additional info.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ Description = @"The error additional info.",
+ SerializedName = @"additionalInfo",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo) })]
+ System.Collections.Generic.List AdditionalInfo { get; }
+ /// The error code.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ Description = @"The error code.",
+ SerializedName = @"code",
+ PossibleTypes = new [] { typeof(string) })]
+ string Code { get; }
+ /// The error details.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ Description = @"The error details.",
+ SerializedName = @"details",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail) })]
+ System.Collections.Generic.List Detail { get; }
+ /// The error message.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ Description = @"The error message.",
+ SerializedName = @"message",
+ PossibleTypes = new [] { typeof(string) })]
+ string Message { get; }
+ /// The error target.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ Description = @"The error target.",
+ SerializedName = @"target",
+ PossibleTypes = new [] { typeof(string) })]
+ string Target { get; }
+
+ }
+ /// The error detail.
+ internal partial interface IErrorDetailInternal
+
+ {
+ /// The error additional info.
+ System.Collections.Generic.List AdditionalInfo { get; set; }
+ /// The error code.
+ string Code { get; set; }
+ /// The error details.
+ System.Collections.Generic.List 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/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.json.cs
new file mode 100644
index 000000000000..5f9f8ec11044
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorDetail.json.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal ErrorDetail(Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorDetail.FromJson(__u) )) ))() : null : _detail;}
+ {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : _additionalInfo;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail.
+ ///
+ /// a to deserialize from.
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeRead))
+ {
+ AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeRead))
+ {
+ AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeRead))
+ {
+ AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeRead))
+ {
+ if (null != this._detail)
+ {
+ var __w = new Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.SerializationMode.IncludeRead))
+ {
+ if (null != this._additionalInfo)
+ {
+ var __r = new Microsoft.Azure.PowerShell.Cmdlets.Metric.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/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs
new file mode 100644
index 000000000000..9b7eff076f8c
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.PowerShell.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows
+ /// the OData error response format.).
+ ///
+ [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))]
+ public partial class ErrorResponse
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new ErrorResponse(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new ErrorResponse(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal ErrorResponse(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Error"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorDetailTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Code"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString);
+ }
+ if (content.Contains("Message"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString);
+ }
+ if (content.Contains("Target"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString);
+ }
+ if (content.Contains("Detail"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorDetailTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("AdditionalInfo"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal ErrorResponse(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Error"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorDetailTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Code"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString);
+ }
+ if (content.Contains("Message"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString);
+ }
+ if (content.Contains("Target"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString);
+ }
+ if (content.Contains("Detail"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorDetailTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("AdditionalInfo"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows
+ /// the OData error response format.).
+ [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))]
+ public partial interface IErrorResponse
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs
new file mode 100644
index 000000000000..f173dc22c153
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class ErrorResponseTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return ErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return ErrorResponse.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return ErrorResponse.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.cs
new file mode 100644
index 000000000000..68d9c6774881
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.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 ErrorResponse :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal
+ {
+
+ /// The error additional info.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Inlined)]
+ public System.Collections.Generic.List AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).AdditionalInfo; }
+
+ /// The error code.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Inlined)]
+ public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Code; }
+
+ /// The error details.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Inlined)]
+ public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Detail; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail _error;
+
+ /// The error object.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ internal Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorDetail()); set => this._error = value; }
+
+ /// The error message.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Inlined)]
+ public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Message; }
+
+ /// Internal Acessors for AdditionalInfo
+ System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).AdditionalInfo = value; }
+
+ /// Internal Acessors for Code
+ string Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Code = value; }
+
+ /// Internal Acessors for Detail
+ System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Detail = value; }
+
+ /// Internal Acessors for Error
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ErrorDetail()); set { {_error = value;} } }
+
+ /// Internal Acessors for Message
+ string Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Message = value; }
+
+ /// Internal Acessors for Target
+ string Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Target = value; }
+
+ /// The error target.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Inlined)]
+ public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetailInternal)Error).Target; }
+
+ /// Creates an new instance.
+ public ErrorResponse()
+ {
+
+ }
+ }
+ /// 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 IErrorResponse :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IJsonSerializable
+ {
+ /// The error additional info.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ Description = @"The error additional info.",
+ SerializedName = @"additionalInfo",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorAdditionalInfo) })]
+ System.Collections.Generic.List AdditionalInfo { get; }
+ /// The error code.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ Description = @"The error code.",
+ SerializedName = @"code",
+ PossibleTypes = new [] { typeof(string) })]
+ string Code { get; }
+ /// The error details.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ Description = @"The error details.",
+ SerializedName = @"details",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorDetail) })]
+ System.Collections.Generic.List Detail { get; }
+ /// The error message.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ Description = @"The error message.",
+ SerializedName = @"message",
+ PossibleTypes = new [] { typeof(string) })]
+ string Message { get; }
+ /// The error target.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Read = true,
+ Create = false,
+ Update = false,
+ 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 IErrorResponseInternal
+
+ {
+ /// The error additional info.
+ System.Collections.Generic.List AdditionalInfo { get; set; }
+ /// The error code.
+ string Code { get; set; }
+ /// The error details.
+ System.Collections.Generic.List Detail { get; set; }
+ /// The error object.
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.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/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.json.cs
new file mode 100644
index 000000000000..ae43fc45c200
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ErrorResponse.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.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 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.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Models.ErrorDetail.FromJson(__jsonError) : _error;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse.
+ ///
+ /// a to deserialize from.
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.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/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.PowerShell.cs
new file mode 100644
index 000000000000..10244dedc9f4
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.PowerShell.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.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ /// The localizable string class.
+ [System.ComponentModel.TypeConverter(typeof(LocalizableStringTypeConverter))]
+ public partial class LocalizableString
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new LocalizableString(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new LocalizableString(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal LocalizableString(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)this).Value, global::System.Convert.ToString);
+ }
+ if (content.Contains("LocalizedValue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)this).LocalizedValue, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal LocalizableString(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)this).Value, global::System.Convert.ToString);
+ }
+ if (content.Contains("LocalizedValue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)this).LocalizedValue, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// The localizable string class.
+ [System.ComponentModel.TypeConverter(typeof(LocalizableStringTypeConverter))]
+ public partial interface ILocalizableString
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.TypeConverter.cs
new file mode 100644
index 000000000000..9ae921946911
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class LocalizableStringTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return LocalizableString.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return LocalizableString.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return LocalizableString.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.cs
new file mode 100644
index 000000000000..5535ff44e285
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// The localizable string class.
+ public partial class LocalizableString :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal
+ {
+
+ /// Backing field for property.
+ private string _localizedValue;
+
+ /// The display name.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string LocalizedValue { get => this._localizedValue; set => this._localizedValue = value; }
+
+ /// Backing field for property.
+ private string _value;
+
+ /// The invariant value.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Value { get => this._value; set => this._value = value; }
+
+ /// Creates an new instance.
+ public LocalizableString()
+ {
+
+ }
+ }
+ /// The localizable string class.
+ public partial interface ILocalizableString :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IJsonSerializable
+ {
+ /// The display name.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The display name.",
+ SerializedName = @"localizedValue",
+ PossibleTypes = new [] { typeof(string) })]
+ string LocalizedValue { get; set; }
+ /// The invariant value.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The invariant value.",
+ SerializedName = @"value",
+ PossibleTypes = new [] { typeof(string) })]
+ string Value { get; set; }
+
+ }
+ /// The localizable string class.
+ internal partial interface ILocalizableStringInternal
+
+ {
+ /// The display name.
+ string LocalizedValue { get; set; }
+ /// The invariant value.
+ string Value { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.json.cs
new file mode 100644
index 000000000000..dc05fada26f8
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/LocalizableString.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// The localizable string class.
+ public partial class LocalizableString
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json ? new LocalizableString(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal LocalizableString(Microsoft.Azure.PowerShell.Cmdlets.Metric.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;}
+ {_localizedValue = If( json?.PropertyT("localizedValue"), out var __jsonLocalizedValue) ? (string)__jsonLocalizedValue : (string)_localizedValue;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add );
+ AddIf( null != (((object)this._localizedValue)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._localizedValue.ToString()) : null, "localizedValue" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.PowerShell.cs
new file mode 100644
index 000000000000..3fa351cf471b
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.PowerShell.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ /// Represents a metric metadata value.
+ [System.ComponentModel.TypeConverter(typeof(MetadataValueTypeConverter))]
+ public partial class MetadataValue
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValue DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new MetadataValue(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValue DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new MetadataValue(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValue FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal MetadataValue(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableStringTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).Value, global::System.Convert.ToString);
+ }
+ if (content.Contains("NameValue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).NameValue, global::System.Convert.ToString);
+ }
+ if (content.Contains("NameLocalizedValue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).NameLocalizedValue, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal MetadataValue(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableStringTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).Value, global::System.Convert.ToString);
+ }
+ if (content.Contains("NameValue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).NameValue, global::System.Convert.ToString);
+ }
+ if (content.Contains("NameLocalizedValue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal)this).NameLocalizedValue, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// Represents a metric metadata value.
+ [System.ComponentModel.TypeConverter(typeof(MetadataValueTypeConverter))]
+ public partial interface IMetadataValue
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.TypeConverter.cs
new file mode 100644
index 000000000000..414b19adc1a6
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class MetadataValueTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValue ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValue).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return MetadataValue.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return MetadataValue.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return MetadataValue.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.cs
new file mode 100644
index 000000000000..66d38027901a
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// Represents a metric metadata value.
+ public partial class MetadataValue :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValue,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal
+ {
+
+ /// Internal Acessors for Name
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValueInternal.Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableString()); set { {_name = value;} } }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString _name;
+
+ /// The name of the metadata.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ internal Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableString()); set => this._name = value; }
+
+ /// The display name.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Inlined)]
+ public string NameLocalizedValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)Name).LocalizedValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)Name).LocalizedValue = value ?? null; }
+
+ /// The invariant value.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Inlined)]
+ public string NameValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)Name).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)Name).Value = value ?? null; }
+
+ /// Backing field for property.
+ private string _value;
+
+ /// The value of the metadata.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Value { get => this._value; set => this._value = value; }
+
+ /// Creates an new instance.
+ public MetadataValue()
+ {
+
+ }
+ }
+ /// Represents a metric metadata value.
+ public partial interface IMetadataValue :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IJsonSerializable
+ {
+ /// The display name.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The display name.",
+ SerializedName = @"localizedValue",
+ PossibleTypes = new [] { typeof(string) })]
+ string NameLocalizedValue { get; set; }
+ /// The invariant value.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The invariant value.",
+ SerializedName = @"value",
+ PossibleTypes = new [] { typeof(string) })]
+ string NameValue { get; set; }
+ /// The value of the metadata.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The value of the metadata.",
+ SerializedName = @"value",
+ PossibleTypes = new [] { typeof(string) })]
+ string Value { get; set; }
+
+ }
+ /// Represents a metric metadata value.
+ internal partial interface IMetadataValueInternal
+
+ {
+ /// The name of the metadata.
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString Name { get; set; }
+ /// The display name.
+ string NameLocalizedValue { get; set; }
+ /// The invariant value.
+ string NameValue { get; set; }
+ /// The value of the metadata.
+ string Value { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.json.cs
new file mode 100644
index 000000000000..da1312b9f690
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetadataValue.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// Represents a metric metadata value.
+ public partial class MetadataValue
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValue.
+ ///
+ /// a to deserialize from.
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValue.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValue FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json ? new MetadataValue(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal MetadataValue(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_name = If( json?.PropertyT("name"), out var __jsonName) ? Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableString.FromJson(__jsonName) : _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.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != this._name ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) this._name.ToJson(null,serializationMode) : null, "name" ,container.Add );
+ AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.PowerShell.cs
new file mode 100644
index 000000000000..8262ec233962
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.PowerShell.cs
@@ -0,0 +1,236 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ /// The result data of a query.
+ [System.ComponentModel.TypeConverter(typeof(MetricTypeConverter))]
+ public partial class Metric
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetric DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new Metric(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetric DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new Metric(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetric FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal Metric(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableStringTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Id, global::System.Convert.ToString);
+ }
+ if (content.Contains("Type"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Type, global::System.Convert.ToString);
+ }
+ if (content.Contains("DisplayDescription"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).DisplayDescription, global::System.Convert.ToString);
+ }
+ if (content.Contains("ErrorCode"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).ErrorCode, global::System.Convert.ToString);
+ }
+ if (content.Contains("ErrorMessage"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).ErrorMessage, global::System.Convert.ToString);
+ }
+ if (content.Contains("Unit"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Unit, global::System.Convert.ToString);
+ }
+ if (content.Contains("Timesery"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Timesery = (System.Collections.Generic.List) content.GetValueForProperty("Timesery",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Timesery, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.TimeSeriesElementTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NameValue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).NameValue, global::System.Convert.ToString);
+ }
+ if (content.Contains("NameLocalizedValue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).NameLocalizedValue, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal Metric(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableStringTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Id, global::System.Convert.ToString);
+ }
+ if (content.Contains("Type"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Type, global::System.Convert.ToString);
+ }
+ if (content.Contains("DisplayDescription"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).DisplayDescription, global::System.Convert.ToString);
+ }
+ if (content.Contains("ErrorCode"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).ErrorCode, global::System.Convert.ToString);
+ }
+ if (content.Contains("ErrorMessage"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).ErrorMessage, global::System.Convert.ToString);
+ }
+ if (content.Contains("Unit"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Unit, global::System.Convert.ToString);
+ }
+ if (content.Contains("Timesery"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Timesery = (System.Collections.Generic.List) content.GetValueForProperty("Timesery",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).Timesery, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.TimeSeriesElementTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NameValue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).NameValue, global::System.Convert.ToString);
+ }
+ if (content.Contains("NameLocalizedValue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal)this).NameLocalizedValue, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// The result data of a query.
+ [System.ComponentModel.TypeConverter(typeof(MetricTypeConverter))]
+ public partial interface IMetric
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.TypeConverter.cs
new file mode 100644
index 000000000000..dc66899ece61
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class MetricTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetric ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetric).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return Metric.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return Metric.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return Metric.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.cs
new file mode 100644
index 000000000000..e7ed45ed9754
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// The result data of a query.
+ public partial class Metric :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetric,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal
+ {
+
+ /// Backing field for property.
+ private string _displayDescription;
+
+ /// Detailed description of this metric.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string DisplayDescription { get => this._displayDescription; set => this._displayDescription = value; }
+
+ /// Backing field for property.
+ private string _errorCode;
+
+ /// 'Success' or the error details on query failures for this metric.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string ErrorCode { get => this._errorCode; set => this._errorCode = value; }
+
+ /// Backing field for property.
+ private string _errorMessage;
+
+ /// Error message encountered querying this specific metric.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string ErrorMessage { get => this._errorMessage; set => this._errorMessage = value; }
+
+ /// Backing field for property.
+ private string _id;
+
+ /// The metric Id.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Id { get => this._id; set => this._id = value; }
+
+ /// Internal Acessors for Name
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricInternal.Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableString()); set { {_name = value;} } }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString _name;
+
+ /// The name and the display name of the metric, i.e. it is localizable string.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ internal Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableString()); set => this._name = value; }
+
+ /// The display name.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Inlined)]
+ public string NameLocalizedValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)Name).LocalizedValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)Name).LocalizedValue = value ?? null; }
+
+ /// The invariant value.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Inlined)]
+ public string NameValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)Name).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableStringInternal)Name).Value = value ; }
+
+ /// Backing field for property.
+ private System.Collections.Generic.List _timesery;
+
+ /// The time series returned when a data query is performed.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public System.Collections.Generic.List Timesery { get => this._timesery; set => this._timesery = value; }
+
+ /// Backing field for property.
+ private string _type;
+
+ /// The resource type of the metric resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Type { get => this._type; set => this._type = value; }
+
+ /// Backing field for property.
+ private string _unit;
+
+ /// The unit of the metric.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Unit { get => this._unit; set => this._unit = value; }
+
+ /// Creates an new instance.
+ public Metric()
+ {
+
+ }
+ }
+ /// The result data of a query.
+ public partial interface IMetric :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IJsonSerializable
+ {
+ /// Detailed description of this metric.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"Detailed description of this metric.",
+ SerializedName = @"displayDescription",
+ PossibleTypes = new [] { typeof(string) })]
+ string DisplayDescription { get; set; }
+ /// 'Success' or the error details on query failures for this metric.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"'Success' or the error details on query failures for this metric.",
+ SerializedName = @"errorCode",
+ PossibleTypes = new [] { typeof(string) })]
+ string ErrorCode { get; set; }
+ /// Error message encountered querying this specific metric.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"Error message encountered querying this specific metric.",
+ SerializedName = @"errorMessage",
+ PossibleTypes = new [] { typeof(string) })]
+ string ErrorMessage { get; set; }
+ /// The metric Id.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The metric Id.",
+ SerializedName = @"id",
+ PossibleTypes = new [] { typeof(string) })]
+ string Id { get; set; }
+ /// The display name.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The display name.",
+ SerializedName = @"localizedValue",
+ PossibleTypes = new [] { typeof(string) })]
+ string NameLocalizedValue { get; set; }
+ /// The invariant value.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The invariant value.",
+ SerializedName = @"value",
+ PossibleTypes = new [] { typeof(string) })]
+ string NameValue { get; set; }
+ /// The time series returned when a data query is performed.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The time series returned when a data query is performed.",
+ SerializedName = @"timeseries",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElement) })]
+ System.Collections.Generic.List Timesery { get; set; }
+ /// The resource type of the metric resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The resource type of the metric resource.",
+ SerializedName = @"type",
+ PossibleTypes = new [] { typeof(string) })]
+ string Type { get; set; }
+ /// The unit of the metric.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The unit of the metric.",
+ SerializedName = @"unit",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.PSArgumentCompleterAttribute("Count", "Bytes", "Seconds", "CountPerSecond", "BytesPerSecond", "Percent", "MilliSeconds", "ByteSeconds", "Unspecified", "Cores", "MilliCores", "NanoCores", "BitsPerSecond")]
+ string Unit { get; set; }
+
+ }
+ /// The result data of a query.
+ internal partial interface IMetricInternal
+
+ {
+ /// Detailed description of this metric.
+ string DisplayDescription { get; set; }
+ /// 'Success' or the error details on query failures for this metric.
+ string ErrorCode { get; set; }
+ /// Error message encountered querying this specific metric.
+ string ErrorMessage { get; set; }
+ /// The metric Id.
+ string Id { get; set; }
+ /// The name and the display name of the metric, i.e. it is localizable string.
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ILocalizableString Name { get; set; }
+ /// The display name.
+ string NameLocalizedValue { get; set; }
+ /// The invariant value.
+ string NameValue { get; set; }
+ /// The time series returned when a data query is performed.
+ System.Collections.Generic.List Timesery { get; set; }
+ /// The resource type of the metric resource.
+ string Type { get; set; }
+ /// The unit of the metric.
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.PSArgumentCompleterAttribute("Count", "Bytes", "Seconds", "CountPerSecond", "BytesPerSecond", "Percent", "MilliSeconds", "ByteSeconds", "Unspecified", "Cores", "MilliCores", "NanoCores", "BitsPerSecond")]
+ string Unit { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.json.cs
new file mode 100644
index 000000000000..2b4be1a12bef
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/Metric.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// The result data of a query.
+ public partial class Metric
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetric.
+ ///
+ /// a to deserialize from.
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetric.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetric FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json ? new Metric(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal Metric(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_name = If( json?.PropertyT("name"), out var __jsonName) ? Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.LocalizableString.FromJson(__jsonName) : _name;}
+ {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;}
+ {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;}
+ {_displayDescription = If( json?.PropertyT("displayDescription"), out var __jsonDisplayDescription) ? (string)__jsonDisplayDescription : (string)_displayDescription;}
+ {_errorCode = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (string)__jsonErrorCode : (string)_errorCode;}
+ {_errorMessage = If( json?.PropertyT("errorMessage"), out var __jsonErrorMessage) ? (string)__jsonErrorMessage : (string)_errorMessage;}
+ {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)_unit;}
+ {_timesery = If( json?.PropertyT("timeseries"), out var __jsonTimeseries) ? If( __jsonTimeseries as Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElement) (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.TimeSeriesElement.FromJson(__u) )) ))() : null : _timesery;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != this._name ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) this._name.ToJson(null,serializationMode) : null, "name" ,container.Add );
+ AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add );
+ AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add );
+ AddIf( null != (((object)this._displayDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._displayDescription.ToString()) : null, "displayDescription" ,container.Add );
+ AddIf( null != (((object)this._errorCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._errorCode.ToString()) : null, "errorCode" ,container.Add );
+ AddIf( null != (((object)this._errorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._errorMessage.ToString()) : null, "errorMessage" ,container.Add );
+ AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add );
+ if (null != this._timesery)
+ {
+ var __w = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.XNodeArray();
+ foreach( var __x in this._timesery )
+ {
+ AddIf(__x?.ToJson(null, serializationMode) ,__w.Add);
+ }
+ container.Add("timeseries",__w);
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.PowerShell.cs
new file mode 100644
index 000000000000..47f6fbbf2c40
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.PowerShell.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ [System.ComponentModel.TypeConverter(typeof(MetricIdentityTypeConverter))]
+ public partial class MetricIdentity
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new MetricIdentity(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new MetricIdentity(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal MetricIdentity(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("SubscriptionId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentityInternal)this).SubscriptionId, global::System.Convert.ToString);
+ }
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentityInternal)this).Id, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal MetricIdentity(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("SubscriptionId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentityInternal)this).SubscriptionId, global::System.Convert.ToString);
+ }
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentityInternal)this).Id, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ [System.ComponentModel.TypeConverter(typeof(MetricIdentityTypeConverter))]
+ public partial interface IMetricIdentity
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.TypeConverter.cs
new file mode 100644
index 000000000000..932221a0d579
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class MetricIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ // we allow string conversion too.
+ if (type == typeof(global::System.String))
+ {
+ return true;
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ // support direct string to id type conversion.
+ if (type == typeof(global::System.String))
+ {
+ return new MetricIdentity { Id = sourceValue };
+ }
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return MetricIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return MetricIdentity.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return MetricIdentity.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.cs
new file mode 100644
index 000000000000..df6e157e12a6
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ public partial class MetricIdentity :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentityInternal
+ {
+
+ /// Backing field for property.
+ private string _id;
+
+ /// Resource identity path
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Id { get => this._id; set => this._id = value; }
+
+ /// Backing field for property.
+ private string _subscriptionId;
+
+ /// The subscription identifier for the resources in this batch.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; }
+
+ /// Creates an new instance.
+ public MetricIdentity()
+ {
+
+ }
+ }
+ public partial interface IMetricIdentity :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IJsonSerializable
+ {
+ /// Resource identity path
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"Resource identity path",
+ SerializedName = @"id",
+ PossibleTypes = new [] { typeof(string) })]
+ string Id { get; set; }
+ /// The subscription identifier for the resources in this batch.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The subscription identifier for the resources in this batch.",
+ SerializedName = @"subscriptionId",
+ PossibleTypes = new [] { typeof(string) })]
+ string SubscriptionId { get; set; }
+
+ }
+ internal partial interface IMetricIdentityInternal
+
+ {
+ /// Resource identity path
+ string Id { get; set; }
+ /// The subscription identifier for the resources in this batch.
+ string SubscriptionId { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.json.cs
new file mode 100644
index 000000000000..ad5bb69e678d
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricIdentity.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ public partial class MetricIdentity
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json ? new MetricIdentity(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal MetricIdentity(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;}
+ {_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.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add );
+ AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.PowerShell.cs
new file mode 100644
index 000000000000..d3e34cab23f2
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.PowerShell.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ /// The metrics result for a resource.
+ [System.ComponentModel.TypeConverter(typeof(MetricResultsResponseTypeConverter))]
+ public partial class MetricResultsResponse
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new MetricResultsResponse(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new MetricResultsResponse(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal MetricResultsResponse(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricResultsResponseValuesItemTypeConverter.ConvertFrom));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal MetricResultsResponse(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricResultsResponseValuesItemTypeConverter.ConvertFrom));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// The metrics result for a resource.
+ [System.ComponentModel.TypeConverter(typeof(MetricResultsResponseTypeConverter))]
+ public partial interface IMetricResultsResponse
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.TypeConverter.cs
new file mode 100644
index 000000000000..1706399d349f
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class MetricResultsResponseTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return MetricResultsResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return MetricResultsResponse.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return MetricResultsResponse.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.cs
new file mode 100644
index 000000000000..db6e766c4aa8
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// The metrics result for a resource.
+ public partial class MetricResultsResponse :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseInternal
+ {
+
+ /// Backing field for property.
+ private System.Collections.Generic.List _value;
+
+ /// The collection of metric data responses per resource, per metric.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public System.Collections.Generic.List Value { get => this._value; set => this._value = value; }
+
+ /// Creates an new instance.
+ public MetricResultsResponse()
+ {
+
+ }
+ }
+ /// The metrics result for a resource.
+ public partial interface IMetricResultsResponse :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IJsonSerializable
+ {
+ /// The collection of metric data responses per resource, per metric.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The collection of metric data responses per resource, per metric.",
+ SerializedName = @"values",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItem) })]
+ System.Collections.Generic.List Value { get; set; }
+
+ }
+ /// The metrics result for a resource.
+ internal partial interface IMetricResultsResponseInternal
+
+ {
+ /// The collection of metric data responses per resource, per metric.
+ System.Collections.Generic.List Value { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.json.cs
new file mode 100644
index 000000000000..84f505ec82de
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponse.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// The metrics result for a resource.
+ public partial class MetricResultsResponse
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json ? new MetricResultsResponse(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal MetricResultsResponse(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItem) (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricResultsResponseValuesItem.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.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metric.Runtime.Json.XNodeArray();
+ foreach( var __x in this._value )
+ {
+ AddIf(__x?.ToJson(null, serializationMode) ,__w.Add);
+ }
+ container.Add("values",__w);
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.PowerShell.cs
new file mode 100644
index 000000000000..0f515791ee72
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.PowerShell.cs
@@ -0,0 +1,210 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ [System.ComponentModel.TypeConverter(typeof(MetricResultsResponseValuesItemTypeConverter))]
+ public partial class MetricResultsResponseValuesItem
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItem DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new MetricResultsResponseValuesItem(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new MetricResultsResponseValuesItem(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal MetricResultsResponseValuesItem(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Starttime"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Starttime = (string) content.GetValueForProperty("Starttime",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Starttime, global::System.Convert.ToString);
+ }
+ if (content.Contains("Endtime"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Endtime = (string) content.GetValueForProperty("Endtime",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Endtime, global::System.Convert.ToString);
+ }
+ if (content.Contains("Interval"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Interval = (string) content.GetValueForProperty("Interval",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Interval, global::System.Convert.ToString);
+ }
+ if (content.Contains("Namespace"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Namespace = (string) content.GetValueForProperty("Namespace",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Namespace, global::System.Convert.ToString);
+ }
+ if (content.Contains("Resourceregion"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Resourceregion = (string) content.GetValueForProperty("Resourceregion",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Resourceregion, global::System.Convert.ToString);
+ }
+ if (content.Contains("Resourceid"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Resourceid = (string) content.GetValueForProperty("Resourceid",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Resourceid, global::System.Convert.ToString);
+ }
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricTypeConverter.ConvertFrom));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal MetricResultsResponseValuesItem(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Starttime"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Starttime = (string) content.GetValueForProperty("Starttime",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Starttime, global::System.Convert.ToString);
+ }
+ if (content.Contains("Endtime"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Endtime = (string) content.GetValueForProperty("Endtime",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Endtime, global::System.Convert.ToString);
+ }
+ if (content.Contains("Interval"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Interval = (string) content.GetValueForProperty("Interval",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Interval, global::System.Convert.ToString);
+ }
+ if (content.Contains("Namespace"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Namespace = (string) content.GetValueForProperty("Namespace",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Namespace, global::System.Convert.ToString);
+ }
+ if (content.Contains("Resourceregion"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Resourceregion = (string) content.GetValueForProperty("Resourceregion",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Resourceregion, global::System.Convert.ToString);
+ }
+ if (content.Contains("Resourceid"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Resourceid = (string) content.GetValueForProperty("Resourceid",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Resourceid, global::System.Convert.ToString);
+ }
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricTypeConverter.ConvertFrom));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ [System.ComponentModel.TypeConverter(typeof(MetricResultsResponseValuesItemTypeConverter))]
+ public partial interface IMetricResultsResponseValuesItem
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.TypeConverter.cs
new file mode 100644
index 000000000000..0d6a154b8fd2
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class MetricResultsResponseValuesItemTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItem ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItem).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return MetricResultsResponseValuesItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return MetricResultsResponseValuesItem.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return MetricResultsResponseValuesItem.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.cs
new file mode 100644
index 000000000000..14cf050e9804
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.cs
@@ -0,0 +1,184 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ public partial class MetricResultsResponseValuesItem :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItem,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItemInternal
+ {
+
+ /// Backing field for property.
+ private string _endtime;
+
+ /// The end time, in datetime format, for which the data was retrieved.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Endtime { get => this._endtime; set => this._endtime = value; }
+
+ /// Backing field for property.
+ private string _interval;
+
+ ///
+ /// The interval (window size) for which the metric data was returned in ISO 8601 duration format with a special case for
+ /// 'FULL' value that returns single datapoint for entire time span requested (*Examples: PT15M, PT1H, P1D, FULL*).
+ /// This may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Interval { get => this._interval; set => this._interval = value; }
+
+ /// Backing field for property.
+ private string _namespace;
+
+ /// The namespace of the metrics been queried
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Namespace { get => this._namespace; set => this._namespace = value; }
+
+ /// Backing field for property.
+ private string _resourceid;
+
+ /// The resource that has been queried for metrics.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Resourceid { get => this._resourceid; set => this._resourceid = value; }
+
+ /// Backing field for property.
+ private string _resourceregion;
+
+ /// The region of the resource been queried for metrics.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Resourceregion { get => this._resourceregion; set => this._resourceregion = value; }
+
+ /// Backing field for property.
+ private string _starttime;
+
+ /// The start time, in datetime format, for which the data was retrieved.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public string Starttime { get => this._starttime; set => this._starttime = value; }
+
+ /// Backing field for property.
+ private System.Collections.Generic.List _value;
+
+ /// The value of the collection.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public System.Collections.Generic.List Value { get => this._value; set => this._value = value; }
+
+ /// Creates an new instance.
+ public MetricResultsResponseValuesItem()
+ {
+
+ }
+ }
+ public partial interface IMetricResultsResponseValuesItem :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IJsonSerializable
+ {
+ /// The end time, in datetime format, for which the data was retrieved.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The end time, in datetime format, for which the data was retrieved.",
+ SerializedName = @"endtime",
+ PossibleTypes = new [] { typeof(string) })]
+ string Endtime { get; set; }
+ ///
+ /// The interval (window size) for which the metric data was returned in ISO 8601 duration format with a special case for
+ /// 'FULL' value that returns single datapoint for entire time span requested (*Examples: PT15M, PT1H, P1D, FULL*).
+ /// This may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The interval (window size) for which the metric data was returned in ISO 8601 duration format with a special case for 'FULL' value that returns single datapoint for entire time span requested (*Examples: PT15M, PT1H, P1D, FULL*).
+ This may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified.",
+ SerializedName = @"interval",
+ PossibleTypes = new [] { typeof(string) })]
+ string Interval { get; set; }
+ /// The namespace of the metrics been queried
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The namespace of the metrics been queried",
+ SerializedName = @"namespace",
+ PossibleTypes = new [] { typeof(string) })]
+ string Namespace { get; set; }
+ /// The resource that has been queried for metrics.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The resource that has been queried for metrics.",
+ SerializedName = @"resourceid",
+ PossibleTypes = new [] { typeof(string) })]
+ string Resourceid { get; set; }
+ /// The region of the resource been queried for metrics.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The region of the resource been queried for metrics.",
+ SerializedName = @"resourceregion",
+ PossibleTypes = new [] { typeof(string) })]
+ string Resourceregion { get; set; }
+ /// The start time, in datetime format, for which the data was retrieved.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The start time, in datetime format, for which the data was retrieved.",
+ SerializedName = @"starttime",
+ PossibleTypes = new [] { typeof(string) })]
+ string Starttime { get; set; }
+ /// The value of the collection.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The value of the collection.",
+ SerializedName = @"value",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetric) })]
+ System.Collections.Generic.List Value { get; set; }
+
+ }
+ internal partial interface IMetricResultsResponseValuesItemInternal
+
+ {
+ /// The end time, in datetime format, for which the data was retrieved.
+ string Endtime { get; set; }
+ ///
+ /// The interval (window size) for which the metric data was returned in ISO 8601 duration format with a special case for
+ /// 'FULL' value that returns single datapoint for entire time span requested (*Examples: PT15M, PT1H, P1D, FULL*).
+ /// This may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified.
+ ///
+ string Interval { get; set; }
+ /// The namespace of the metrics been queried
+ string Namespace { get; set; }
+ /// The resource that has been queried for metrics.
+ string Resourceid { get; set; }
+ /// The region of the resource been queried for metrics.
+ string Resourceregion { get; set; }
+ /// The start time, in datetime format, for which the data was retrieved.
+ string Starttime { get; set; }
+ /// The value of the collection.
+ System.Collections.Generic.List Value { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.json.cs
new file mode 100644
index 000000000000..a36a59f27eff
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricResultsResponseValuesItem.json.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ public partial class MetricResultsResponseValuesItem
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItem.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItem.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponseValuesItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json ? new MetricResultsResponseValuesItem(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal MetricResultsResponseValuesItem(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_starttime = If( json?.PropertyT("starttime"), out var __jsonStarttime) ? (string)__jsonStarttime : (string)_starttime;}
+ {_endtime = If( json?.PropertyT("endtime"), out var __jsonEndtime) ? (string)__jsonEndtime : (string)_endtime;}
+ {_interval = If( json?.PropertyT("interval"), out var __jsonInterval) ? (string)__jsonInterval : (string)_interval;}
+ {_namespace = If( json?.PropertyT("namespace"), out var __jsonNamespace) ? (string)__jsonNamespace : (string)_namespace;}
+ {_resourceregion = If( json?.PropertyT("resourceregion"), out var __jsonResourceregion) ? (string)__jsonResourceregion : (string)_resourceregion;}
+ {_resourceid = If( json?.PropertyT("resourceid"), out var __jsonResourceid) ? (string)__jsonResourceid : (string)_resourceid;}
+ {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetric) (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.Metric.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.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != (((object)this._starttime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._starttime.ToString()) : null, "starttime" ,container.Add );
+ AddIf( null != (((object)this._endtime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._endtime.ToString()) : null, "endtime" ,container.Add );
+ AddIf( null != (((object)this._interval)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._interval.ToString()) : null, "interval" ,container.Add );
+ AddIf( null != (((object)this._namespace)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._namespace.ToString()) : null, "namespace" ,container.Add );
+ AddIf( null != (((object)this._resourceregion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._resourceregion.ToString()) : null, "resourceregion" ,container.Add );
+ AddIf( null != (((object)this._resourceid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._resourceid.ToString()) : null, "resourceid" ,container.Add );
+ if (null != this._value)
+ {
+ var __w = new Microsoft.Azure.PowerShell.Cmdlets.Metric.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/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.PowerShell.cs
new file mode 100644
index 000000000000..1e9d5e8d6224
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.PowerShell.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ /// Represents a metric value.
+ [System.ComponentModel.TypeConverter(typeof(MetricValueTypeConverter))]
+ public partial class MetricValue
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValue DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new MetricValue(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValue DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new MetricValue(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValue FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal MetricValue(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("TimeStamp"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).TimeStamp = (global::System.DateTime) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).TimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified));
+ }
+ if (content.Contains("Average"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Average = (double?) content.GetValueForProperty("Average",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Average, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double)));
+ }
+ if (content.Contains("Minimum"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Minimum = (double?) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Minimum, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double)));
+ }
+ if (content.Contains("Maximum"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Maximum = (double?) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Maximum, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double)));
+ }
+ if (content.Contains("Total"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Total = (double?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Total, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double)));
+ }
+ if (content.Contains("Count"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Count = (double?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Count, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double)));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal MetricValue(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("TimeStamp"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).TimeStamp = (global::System.DateTime) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).TimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified));
+ }
+ if (content.Contains("Average"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Average = (double?) content.GetValueForProperty("Average",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Average, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double)));
+ }
+ if (content.Contains("Minimum"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Minimum = (double?) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Minimum, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double)));
+ }
+ if (content.Contains("Maximum"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Maximum = (double?) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Maximum, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double)));
+ }
+ if (content.Contains("Total"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Total = (double?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Total, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double)));
+ }
+ if (content.Contains("Count"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Count = (double?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal)this).Count, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double)));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// Represents a metric value.
+ [System.ComponentModel.TypeConverter(typeof(MetricValueTypeConverter))]
+ public partial interface IMetricValue
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.TypeConverter.cs
new file mode 100644
index 000000000000..67b7db65661d
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class MetricValueTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValue ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValue).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return MetricValue.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return MetricValue.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return MetricValue.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.cs
new file mode 100644
index 000000000000..d66852ad2c4e
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// Represents a metric value.
+ public partial class MetricValue :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValue,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValueInternal
+ {
+
+ /// Backing field for property.
+ private double? _average;
+
+ /// The average value in the time range.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public double? Average { get => this._average; set => this._average = value; }
+
+ /// Backing field for property.
+ private double? _count;
+
+ ///
+ /// The number of samples in the time range. Can be used to determine the number of values that contributed to the average
+ /// value.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public double? Count { get => this._count; set => this._count = value; }
+
+ /// Backing field for property.
+ private double? _maximum;
+
+ /// The greatest value in the time range.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public double? Maximum { get => this._maximum; set => this._maximum = value; }
+
+ /// Backing field for property.
+ private double? _minimum;
+
+ /// The least value in the time range.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public double? Minimum { get => this._minimum; set => this._minimum = value; }
+
+ /// Backing field for property.
+ private global::System.DateTime _timeStamp;
+
+ /// The timestamp for the metric value in ISO 8601 format.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public global::System.DateTime TimeStamp { get => this._timeStamp; set => this._timeStamp = value; }
+
+ /// Backing field for property.
+ private double? _total;
+
+ /// The sum of all of the values in the time range.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public double? Total { get => this._total; set => this._total = value; }
+
+ /// Creates an new instance.
+ public MetricValue()
+ {
+
+ }
+ }
+ /// Represents a metric value.
+ public partial interface IMetricValue :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IJsonSerializable
+ {
+ /// The average value in the time range.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The average value in the time range.",
+ SerializedName = @"average",
+ PossibleTypes = new [] { typeof(double) })]
+ double? Average { get; set; }
+ ///
+ /// The number of samples in the time range. Can be used to determine the number of values that contributed to the average
+ /// value.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The number of samples in the time range. Can be used to determine the number of values that contributed to the average value.",
+ SerializedName = @"count",
+ PossibleTypes = new [] { typeof(double) })]
+ double? Count { get; set; }
+ /// The greatest value in the time range.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The greatest value in the time range.",
+ SerializedName = @"maximum",
+ PossibleTypes = new [] { typeof(double) })]
+ double? Maximum { get; set; }
+ /// The least value in the time range.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The least value in the time range.",
+ SerializedName = @"minimum",
+ PossibleTypes = new [] { typeof(double) })]
+ double? Minimum { get; set; }
+ /// The timestamp for the metric value in ISO 8601 format.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The timestamp for the metric value in ISO 8601 format.",
+ SerializedName = @"timeStamp",
+ PossibleTypes = new [] { typeof(global::System.DateTime) })]
+ global::System.DateTime TimeStamp { get; set; }
+ /// The sum of all of the values in the time range.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The sum of all of the values in the time range.",
+ SerializedName = @"total",
+ PossibleTypes = new [] { typeof(double) })]
+ double? Total { get; set; }
+
+ }
+ /// Represents a metric value.
+ internal partial interface IMetricValueInternal
+
+ {
+ /// The average value in the time range.
+ double? Average { get; set; }
+ ///
+ /// The number of samples in the time range. Can be used to determine the number of values that contributed to the average
+ /// value.
+ ///
+ double? Count { get; set; }
+ /// The greatest value in the time range.
+ double? Maximum { get; set; }
+ /// The least value in the time range.
+ double? Minimum { get; set; }
+ /// The timestamp for the metric value in ISO 8601 format.
+ global::System.DateTime TimeStamp { get; set; }
+ /// The sum of all of the values in the time range.
+ double? Total { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.json.cs
new file mode 100644
index 000000000000..2ad6a2951b03
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/MetricValue.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// Represents a metric value.
+ public partial class MetricValue
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValue.
+ ///
+ /// a to deserialize from.
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValue.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValue FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json ? new MetricValue(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal MetricValue(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_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;}
+ {_average = If( json?.PropertyT("average"), out var __jsonAverage) ? (double?)__jsonAverage : _average;}
+ {_minimum = If( json?.PropertyT("minimum"), out var __jsonMinimum) ? (double?)__jsonMinimum : _minimum;}
+ {_maximum = If( json?.PropertyT("maximum"), out var __jsonMaximum) ? (double?)__jsonMaximum : _maximum;}
+ {_total = If( json?.PropertyT("total"), out var __jsonTotal) ? (double?)__jsonTotal : _total;}
+ {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (double?)__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.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(this._timeStamp.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "timeStamp" ,container.Add );
+ AddIf( null != this._average ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNumber((double)this._average) : null, "average" ,container.Add );
+ AddIf( null != this._minimum ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNumber((double)this._minimum) : null, "minimum" ,container.Add );
+ AddIf( null != this._maximum ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNumber((double)this._maximum) : null, "maximum" ,container.Add );
+ AddIf( null != this._total ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNumber((double)this._total) : null, "total" ,container.Add );
+ AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNumber((double)this._count) : null, "count" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.PowerShell.cs
new file mode 100644
index 000000000000..35a3c04ec7df
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.PowerShell.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ /// The comma separated list of resource IDs to query metrics for.
+ [System.ComponentModel.TypeConverter(typeof(ResourceIdListTypeConverter))]
+ public partial class ResourceIdList
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new ResourceIdList(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new ResourceIdList(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal ResourceIdList(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Resourceid"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdListInternal)this).Resourceid = (System.Collections.Generic.List) content.GetValueForProperty("Resourceid",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdListInternal)this).Resourceid, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal ResourceIdList(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Resourceid"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdListInternal)this).Resourceid = (System.Collections.Generic.List) content.GetValueForProperty("Resourceid",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdListInternal)this).Resourceid, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// The comma separated list of resource IDs to query metrics for.
+ [System.ComponentModel.TypeConverter(typeof(ResourceIdListTypeConverter))]
+ public partial interface IResourceIdList
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.TypeConverter.cs
new file mode 100644
index 000000000000..2d3eba98fd3e
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class ResourceIdListTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return ResourceIdList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return ResourceIdList.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return ResourceIdList.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.cs
new file mode 100644
index 000000000000..032beea4b2e3
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// The comma separated list of resource IDs to query metrics for.
+ public partial class ResourceIdList :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdListInternal
+ {
+
+ /// Backing field for property.
+ private System.Collections.Generic.List _resourceid;
+
+ /// The list of resource IDs to query metrics for.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public System.Collections.Generic.List Resourceid { get => this._resourceid; set => this._resourceid = value; }
+
+ /// Creates an new instance.
+ public ResourceIdList()
+ {
+
+ }
+ }
+ /// The comma separated list of resource IDs to query metrics for.
+ public partial interface IResourceIdList :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IJsonSerializable
+ {
+ /// The list of resource IDs to query metrics for.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The list of resource IDs to query metrics for.",
+ SerializedName = @"resourceids",
+ PossibleTypes = new [] { typeof(string) })]
+ System.Collections.Generic.List Resourceid { get; set; }
+
+ }
+ /// The comma separated list of resource IDs to query metrics for.
+ internal partial interface IResourceIdListInternal
+
+ {
+ /// The list of resource IDs to query metrics for.
+ System.Collections.Generic.List Resourceid { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.json.cs
new file mode 100644
index 000000000000..6536b0fe817c
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/ResourceIdList.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ /// The comma separated list of resource IDs to query metrics for.
+ public partial class ResourceIdList
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json ? new ResourceIdList(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal ResourceIdList(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_resourceid = If( json?.PropertyT("resourceids"), out var __jsonResourceids) ? If( __jsonResourceids as Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _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.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (null != this._resourceid)
+ {
+ var __w = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.XNodeArray();
+ foreach( var __x in this._resourceid )
+ {
+ AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add);
+ }
+ container.Add("resourceids",__w);
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.PowerShell.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.PowerShell.cs
new file mode 100644
index 000000000000..ebb55ca0b24a
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.PowerShell.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A time series result type. The discriminator value is always TimeSeries in this case.
+ ///
+ [System.ComponentModel.TypeConverter(typeof(TimeSeriesElementTypeConverter))]
+ public partial class TimeSeriesElement
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElement DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new TimeSeriesElement(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElement DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new TimeSeriesElement(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElement FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal TimeSeriesElement(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Metadatavalue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElementInternal)this).Metadatavalue = (System.Collections.Generic.List) content.GetValueForProperty("Metadatavalue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElementInternal)this).Metadatavalue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetadataValueTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("Data"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElementInternal)this).Data = (System.Collections.Generic.List) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElementInternal)this).Data, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricValueTypeConverter.ConvertFrom));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal TimeSeriesElement(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Metadatavalue"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElementInternal)this).Metadatavalue = (System.Collections.Generic.List) content.GetValueForProperty("Metadatavalue",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElementInternal)this).Metadatavalue, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetadataValueTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("Data"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElementInternal)this).Data = (System.Collections.Generic.List) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElementInternal)this).Data, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricValueTypeConverter.ConvertFrom));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// A time series result type. The discriminator value is always TimeSeries in this case.
+ [System.ComponentModel.TypeConverter(typeof(TimeSeriesElementTypeConverter))]
+ public partial interface ITimeSeriesElement
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.TypeConverter.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.TypeConverter.cs
new file mode 100644
index 000000000000..41f0b26ce104
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.TypeConverter.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.Metric.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class TimeSeriesElementTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// type.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the
+ /// parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter into an instance of
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElement ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElement).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return TimeSeriesElement.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return TimeSeriesElement.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return TimeSeriesElement.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.cs
new file mode 100644
index 000000000000..43c021013db2
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.cs
@@ -0,0 +1,82 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ ///
+ /// A time series result type. The discriminator value is always TimeSeries in this case.
+ ///
+ public partial class TimeSeriesElement :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElement,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElementInternal
+ {
+
+ /// Backing field for property.
+ private System.Collections.Generic.List _data;
+
+ ///
+ /// An array of data points representing the metric values. This is only returned if a result type of data is specified.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public System.Collections.Generic.List Data { get => this._data; set => this._data = value; }
+
+ /// Backing field for property.
+ private System.Collections.Generic.List _metadatavalue;
+
+ /// The metadata values returned if $filter was specified in the call.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Origin(Microsoft.Azure.PowerShell.Cmdlets.Metric.PropertyOrigin.Owned)]
+ public System.Collections.Generic.List Metadatavalue { get => this._metadatavalue; set => this._metadatavalue = value; }
+
+ /// Creates an new instance.
+ public TimeSeriesElement()
+ {
+
+ }
+ }
+ /// A time series result type. The discriminator value is always TimeSeries in this case.
+ public partial interface ITimeSeriesElement :
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IJsonSerializable
+ {
+ ///
+ /// An array of data points representing the metric values. This is only returned if a result type of data is specified.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"An array of data points representing the metric values. This is only returned if a result type of data is specified.",
+ SerializedName = @"data",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValue) })]
+ System.Collections.Generic.List Data { get; set; }
+ /// The metadata values returned if $filter was specified in the call.
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Read = true,
+ Create = true,
+ Update = true,
+ Description = @"The metadata values returned if $filter was specified in the call.",
+ SerializedName = @"metadatavalues",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValue) })]
+ System.Collections.Generic.List Metadatavalue { get; set; }
+
+ }
+ /// A time series result type. The discriminator value is always TimeSeries in this case.
+ internal partial interface ITimeSeriesElementInternal
+
+ {
+ ///
+ /// An array of data points representing the metric values. This is only returned if a result type of data is specified.
+ ///
+ System.Collections.Generic.List Data { get; set; }
+ /// The metadata values returned if $filter was specified in the call.
+ System.Collections.Generic.List Metadatavalue { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.json.cs b/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.json.cs
new file mode 100644
index 000000000000..1f82d1230e1f
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/api/Models/TimeSeriesElement.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.Metric.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+
+ ///
+ /// A time series result type. The discriminator value is always TimeSeries in this case.
+ ///
+ public partial class TimeSeriesElement
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the
+ /// output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output
+ /// parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElement.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElement.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ITimeSeriesElement FromJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json ? new TimeSeriesElement(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject instance to deserialize from.
+ internal TimeSeriesElement(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_metadatavalue = If( json?.PropertyT("metadatavalues"), out var __jsonMetadatavalues) ? If( __jsonMetadatavalues as Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetadataValue) (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetadataValue.FromJson(__u) )) ))() : null : _metadatavalue;}
+ {_data = If( json?.PropertyT("data"), out var __jsonData) ? If( __jsonData as Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricValue) (Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.MetricValue.FromJson(__p) )) ))() : null : _data;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (null != this._metadatavalue)
+ {
+ var __w = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.XNodeArray();
+ foreach( var __x in this._metadatavalue )
+ {
+ AddIf(__x?.ToJson(null, serializationMode) ,__w.Add);
+ }
+ container.Add("metadatavalues",__w);
+ }
+ if (null != this._data)
+ {
+ var __r = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Json.XNodeArray();
+ foreach( var __s in this._data )
+ {
+ AddIf(__s?.ToJson(null, serializationMode) ,__r.Add);
+ }
+ container.Add("data",__r);
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/cmdlets/GetAzMetricsBatch_BatchExpanded.cs b/src/Monitor/MetricsData.Autorest/generated/cmdlets/GetAzMetricsBatch_BatchExpanded.cs
new file mode 100644
index 000000000000..9567b31b85e3
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/cmdlets/GetAzMetricsBatch_BatchExpanded.cs
@@ -0,0 +1,672 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric.Cmdlets
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Cmdlets;
+ using System;
+
+ /// Lists the metric values for multiple resources.
+ ///
+ /// [OpenAPI] Batch=>POST:"/subscriptions/{subscriptionId}/metrics:getBatch"
+ ///
+ [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMetricsBatch_BatchExpanded", SupportsShouldProcess = true)]
+ [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse))]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Description(@"Lists the metric values for multiple resources.")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Generated]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.HttpPath(Path = "/subscriptions/{subscriptionId}/metrics:getBatch", ApiVersion = "2023-10-01")]
+ public partial class GetAzMetricsBatch_BatchExpanded : global::System.Management.Automation.PSCmdlet,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IContext
+ {
+ /// A unique id generatd for the this cmdlet when it is instantiated.
+ private string __correlationId = System.Guid.NewGuid().ToString();
+
+ /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)
+ private global::System.Management.Automation.InvocationInfo __invocationInfo;
+
+ /// A unique id generatd for the this cmdlet when ProcessRecord() is called.
+ private string __processRecordId;
+
+ /// The comma separated list of resource IDs to query metrics for.
+ private Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList _batchRequestBody = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ResourceIdList();
+
+ ///
+ /// The for this operation.
+ ///
+ private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource();
+
+ /// A dictionary to carry over additional data for pipeline.
+ private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary();
+
+ /// A buffer to record first returned object in response.
+ private object _firstResponse = null;
+
+ ///
+ /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object.
+ /// Two means multiple returned objects in response.
+ ///
+ private int _responseSize = 0;
+
+ /// Backing field for property.
+ private string _aggregation;
+
+ ///
+ /// The list of aggregation types (comma separated) to retrieve.
+ /// *Examples: average, minimum, maximum*
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of aggregation types (comma separated) to retrieve.\n*Examples: average, minimum, maximum*")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The list of aggregation types (comma separated) to retrieve.
+ *Examples: average, minimum, maximum*",
+ SerializedName = @"aggregation",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Aggregation { get => this._aggregation; set => this._aggregation = value; }
+
+ /// Wait for .NET debugger to attach
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.SwitchParameter Break { get; set; }
+
+ /// Accessor for cancellationTokenSource.
+ public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } }
+
+ /// The reference to the client API class.
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Metric Client => Microsoft.Azure.PowerShell.Cmdlets.Metric.Module.Instance.ClientAPI;
+
+ ///
+ /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet
+ /// against a different subscription
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Azure)]
+ public global::System.Management.Automation.PSObject DefaultProfile { get; set; }
+
+ /// Backing field for property.
+ private string _endTime;
+
+ ///
+ /// The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.",
+ SerializedName = @"endtime",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string EndTime { get => this._endTime; set => this._endTime = value; }
+
+ /// Backing field for property.
+ private string _endpoint;
+
+ ///
+ /// The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match the region
+ /// of the requested resources. For global resources, the region should be 'global'.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match the region of the requested resources. For global resources, the region should be 'global'.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match the region of the requested resources. For global resources, the region should be 'global'.",
+ SerializedName = @"endpoint",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Uri)]
+ public string Endpoint { get => this._endpoint; set => this._endpoint = value; }
+
+ /// Accessor for extensibleParameters.
+ public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; }
+
+ /// Backing field for property.
+ private string _filter;
+
+ ///
+ /// The filter is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. -
+ /// Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’** -
+ /// Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid because the logical
+ /// or operator cannot separate two different metadata names. - Return all time series where A = a1, B = b1 and C = c1: **filter=A
+ /// eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A eq ‘a1’ and B eq ‘*’ and
+ /// C eq ‘*’**.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The filter is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’** - Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1, B = b1 and C = c1: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The filter is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’** - Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1, B = b1 and C = c1: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.",
+ SerializedName = @"filter",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Filter { get => this._filter; set => this._filter = value; }
+
+ /// SendAsync Pipeline Steps to be appended to the front of the pipeline
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; }
+
+ /// SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; }
+
+ /// Backing field for property.
+ private string _interval;
+
+ ///
+ /// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value
+ /// that returns single datapoint for entire time span requested.
+ /// *Examples: PT15M, PT1H, P1D, FULL*
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested.\n*Examples: PT15M, PT1H, P1D, FULL*")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested.
+ *Examples: PT15M, PT1H, P1D, FULL*",
+ SerializedName = @"interval",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Interval { get => this._interval; set => this._interval = value; }
+
+ /// Accessor for our copy of the InvocationInfo.
+ public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } }
+
+ ///
+ /// cancellation delegate. Stops the cmdlet when called.
+ ///
+ global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel;
+
+ /// cancellation token.
+ global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener.Token => _cancellationTokenSource.Token;
+
+ /// Backing field for property.
+ private System.Collections.Generic.List _name;
+
+ /// The names of the metrics (comma separated) to retrieve.
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The names of the metrics (comma separated) to retrieve.")]
+ [global::System.Management.Automation.AllowEmptyCollection]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"The names of the metrics (comma separated) to retrieve.",
+ SerializedName = @"metricnames",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::System.Management.Automation.Alias("MetricName")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public System.Collections.Generic.List Name { get => this._name; set => this._name = value; }
+
+ /// Backing field for property.
+ private string _namespace;
+
+ /// Metric namespace that contains the requested metric names.
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Metric namespace that contains the requested metric names.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"Metric namespace that contains the requested metric names.",
+ SerializedName = @"metricnamespace",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::System.Management.Automation.Alias("MetricNamespace")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Namespace { get => this._namespace; set => this._namespace = value; }
+
+ /// Backing field for property.
+ private string _orderby;
+
+ ///
+ /// The aggregation to use for sorting results and the direction of the sort.
+ /// Only one order can be specified.
+ /// *Examples: sum asc*
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The aggregation to use for sorting results and the direction of the sort.\nOnly one order can be specified.\n*Examples: sum asc*")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The aggregation to use for sorting results and the direction of the sort.
+ Only one order can be specified.
+ *Examples: sum asc*",
+ SerializedName = @"orderby",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Orderby { get => this._orderby; set => this._orderby = value; }
+
+ ///
+ /// The instance of the that the remote call will use.
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpPipeline Pipeline { get; set; }
+
+ /// The URI for the proxy server to use
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public global::System.Uri Proxy { get; set; }
+
+ /// Credentials for a proxy server to use for the remote call
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.PSCredential ProxyCredential { get; set; }
+
+ /// Use the default credentials for the proxy
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; }
+
+ /// The list of resource IDs to query metrics for.
+ [global::System.Management.Automation.AllowEmptyCollection]
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of resource IDs to query metrics for.")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Body)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The list of resource IDs to query metrics for.",
+ SerializedName = @"resourceids",
+ PossibleTypes = new [] { typeof(string) })]
+ public string[] ResourceId { get => _batchRequestBody.Resourceid?.ToArray() ?? null /* fixedArrayOf */; set => _batchRequestBody.Resourceid = (value != null ? new System.Collections.Generic.List(value) : null); }
+
+ /// Backing field for property.
+ private string _rollupby;
+
+ ///
+ /// Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq
+ /// Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see
+ /// the results for Seattle and Tacoma rolled up into one timeseries.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.",
+ SerializedName = @"rollupby",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Rollupby { get => this._rollupby; set => this._rollupby = value; }
+
+ /// Backing field for property.
+ private string _startTime;
+
+ ///
+ /// The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime
+ /// parameter, then this parameter is required.
+ /// If only starttime is specified, then endtime defaults to the current time.
+ /// If no time interval is specified, the default is 1 hour.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime parameter, then this parameter is required.\nIf only starttime is specified, then endtime defaults to the current time.\nIf no time interval is specified, the default is 1 hour.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime parameter, then this parameter is required.
+ If only starttime is specified, then endtime defaults to the current time.
+ If no time interval is specified, the default is 1 hour.",
+ SerializedName = @"starttime",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string StartTime { get => this._startTime; set => this._startTime = value; }
+
+ /// Backing field for property.
+ private string[] _subscriptionId;
+
+ /// The subscription identifier for the resources in this batch.
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription identifier for the resources in this batch.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"The subscription identifier for the resources in this batch.",
+ SerializedName = @"subscriptionId",
+ PossibleTypes = new [] { typeof(string) })]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.DefaultInfo(
+ Name = @"",
+ Description =@"",
+ Script = @"(Get-AzContext).Subscription.Id",
+ SetCondition = @"")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Path)]
+ public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; }
+
+ /// Backing field for property.
+ private int _top;
+
+ ///
+ /// The maximum number of records to retrieve per resource ID in the request.
+ /// Valid only if filter is specified.
+ /// Defaults to 10.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum number of records to retrieve per resource ID in the request.\nValid only if filter is specified.\nDefaults to 10.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The maximum number of records to retrieve per resource ID in the request.
+ Valid only if filter is specified.
+ Defaults to 10.",
+ SerializedName = @"top",
+ PossibleTypes = new [] { typeof(int) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public int Top { get => this._top; set => this._top = value; }
+
+ ///
+ /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what
+ /// happens on that response. Implement this method in a partial class to enable this behavior
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse
+ /// from the remote call
+ /// /// Determines if the rest of the onDefault method should be processed, or if the method should
+ /// return immediately (set to true to skip further processing )
+
+ partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow);
+
+ ///
+ /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens
+ /// on that response. Implement this method in a partial class to enable this behavior
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse
+ /// from the remote call
+ /// /// Determines if the rest of the onOk method should be processed, or if the method should return
+ /// immediately (set to true to skip further processing )
+
+ partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow);
+
+ ///
+ /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet)
+ ///
+ protected override void BeginProcessing()
+ {
+ var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Metric.Module.Instance.GetTelemetryId.Invoke();
+ if (telemetryId != "" && telemetryId != "internal")
+ {
+ __correlationId = telemetryId;
+ }
+ Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials);
+ if (Break)
+ {
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.AttachDebugger.Break();
+ }
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+
+ /// Performs clean-up after the command execution
+ protected override void EndProcessing()
+ {
+ if (1 ==_responseSize)
+ {
+ // Flush buffer
+ WriteObject(_firstResponse);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the cmdlet class.
+ ///
+ public GetAzMetricsBatch_BatchExpanded()
+ {
+
+ }
+
+ /// Handles/Dispatches events during the call to the REST service.
+ /// The message id
+ /// The message cancellation token. When this call is cancelled, this should be true
+ /// Detailed message data for the message event.
+ ///
+ /// A that will be complete when handling of the message is completed.
+ ///
+ async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData)
+ {
+ using( NoSynchronizationContext )
+ {
+ if (token.IsCancellationRequested)
+ {
+ return ;
+ }
+
+ switch ( id )
+ {
+ case Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.Verbose:
+ {
+ WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.Warning:
+ {
+ WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.Information:
+ {
+ var data = messageData();
+ WriteInformation(data.Message, new string[]{});
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.Debug:
+ {
+ WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.Error:
+ {
+ WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) );
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.Progress:
+ {
+ var data = messageData();
+ int progress = (int)data.Value;
+ string activityMessage, statusDescription;
+ global::System.Management.Automation.ProgressRecordType recordType;
+ if (progress < 100)
+ {
+ activityMessage = "In progress";
+ statusDescription = "Checking operation status";
+ recordType = System.Management.Automation.ProgressRecordType.Processing;
+ }
+ else
+ {
+ activityMessage = "Completed";
+ statusDescription = "Completed";
+ recordType = System.Management.Automation.ProgressRecordType.Completed;
+ }
+ WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription)
+ {
+ PercentComplete = progress,
+ RecordType = recordType
+ });
+ return ;
+ }
+ }
+ await Microsoft.Azure.PowerShell.Cmdlets.Metric.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null );
+ if (token.IsCancellationRequested)
+ {
+ return ;
+ }
+ WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}");
+ }
+ }
+
+ /// Performs execution of the command.
+ protected override void ProcessRecord()
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ __processRecordId = System.Guid.NewGuid().ToString();
+ try
+ {
+ // work
+ if (ShouldProcess($"Call remote 'MetricsBatch' operation"))
+ {
+ using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Token) )
+ {
+ asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Token);
+ }
+ }
+ }
+ catch (global::System.AggregateException aggregateException)
+ {
+ // unroll the inner exceptions to get the root cause
+ foreach( var innerException in aggregateException.Flatten().InnerExceptions )
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ // Write exception out to error channel.
+ WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) );
+ }
+ }
+ catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null)
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ // Write exception out to error channel.
+ WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) );
+ }
+ finally
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.CmdletProcessRecordEnd).Wait();
+ }
+ }
+
+ /// Performs execution of the command, working asynchronously if required.
+ ///
+ /// A that will be complete when handling of the method is completed.
+ ///
+ protected async global::System.Threading.Tasks.Task ProcessRecordAsync()
+ {
+ using( NoSynchronizationContext )
+ {
+ await ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Metric.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters);
+ if (null != HttpPipelinePrepend)
+ {
+ Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend);
+ }
+ if (null != HttpPipelineAppend)
+ {
+ Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend);
+ }
+ // get the client instance
+ try
+ {
+ foreach( var SubscriptionId in this.SubscriptionId )
+ {
+ await ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ await this.Client.MetricsBatch(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("StartTime") ? StartTime : null, this.InvocationInformation.BoundParameters.ContainsKey("EndTime") ? EndTime : null, this.InvocationInformation.BoundParameters.ContainsKey("Interval") ? Interval : null, Namespace, Name, this.InvocationInformation.BoundParameters.ContainsKey("Aggregation") ? Aggregation : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Rollupby") ? Rollupby : null, Endpoint, _batchRequestBody, onOk, onDefault, this, Pipeline);
+ await ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+ }
+ catch (Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.UndeclaredResponseException urexception)
+ {
+ WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Endpoint=Endpoint,StartTime=this.InvocationInformation.BoundParameters.ContainsKey("StartTime") ? StartTime : null,EndTime=this.InvocationInformation.BoundParameters.ContainsKey("EndTime") ? EndTime : null,Interval=this.InvocationInformation.BoundParameters.ContainsKey("Interval") ? Interval : null,Namespace=Namespace,Name=Name,Aggregation=this.InvocationInformation.BoundParameters.ContainsKey("Aggregation") ? Aggregation : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Rollupby=this.InvocationInformation.BoundParameters.ContainsKey("Rollupby") ? Rollupby : null})
+ {
+ ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
+ });
+ }
+ finally
+ {
+ await ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.CmdletProcessRecordAsyncEnd);
+ }
+ }
+ }
+
+ /// Interrupts currently running code within the command.
+ protected override void StopProcessing()
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Cancel();
+ base.StopProcessing();
+ }
+
+ ///
+ /// a delegate that is called when the remote service returns default (any response code not handled elsewhere).
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse
+ /// from the remote call
+ ///
+ /// A that will be complete when handling of the method is completed.
+ ///
+ private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response)
+ {
+ using( NoSynchronizationContext )
+ {
+ var _returnNow = global::System.Threading.Tasks.Task.FromResult(false);
+ overrideOnDefault(responseMessage, response, ref _returnNow);
+ // if overrideOnDefault has returned true, then return right away.
+ if ((null != _returnNow && await _returnNow))
+ {
+ return ;
+ }
+ // Error Response : default
+ var code = (await response)?.Code;
+ var message = (await response)?.Message;
+ if ((null == code || null == message))
+ {
+ // Unrecognized Response. Create an error record based on what we have.
+ var ex = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.RestException(responseMessage, await response);
+ WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { })
+ {
+ ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action }
+ });
+ }
+ else
+ {
+ WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { })
+ {
+ ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty }
+ });
+ }
+ }
+ }
+
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse
+ /// from the remote call
+ ///
+ /// A that will be complete when handling of the method is completed.
+ ///
+ private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response)
+ {
+ using( NoSynchronizationContext )
+ {
+ var _returnNow = global::System.Threading.Tasks.Task.FromResult(false);
+ overrideOnOk(responseMessage, response, ref _returnNow);
+ // if overrideOnOk has returned true, then return right away.
+ if ((null != _returnNow && await _returnNow))
+ {
+ return ;
+ }
+ // onOk - response for 200 / application/json
+ // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse
+ var result = (await response);
+ // response should be returning an array of some kind. +Pageable
+ // nested-array / values /
+ if (null != result.Value)
+ {
+ if (0 == _responseSize && 1 == result.Value.Count)
+ {
+ _firstResponse = result.Value[0];
+ _responseSize = 1;
+ }
+ else
+ {
+ if (1 ==_responseSize)
+ {
+ // Flush buffer
+ WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject());
+ }
+ var values = new System.Collections.Generic.List();
+ foreach( var value in result.Value )
+ {
+ values.Add(value.AddMultipleTypeNameIntoPSObject());
+ }
+ WriteObject(values, true);
+ _responseSize = 2;
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Monitor/MetricsData.Autorest/generated/cmdlets/GetAzMetricsBatch_BatchViaIdentityExpanded.cs b/src/Monitor/MetricsData.Autorest/generated/cmdlets/GetAzMetricsBatch_BatchViaIdentityExpanded.cs
new file mode 100644
index 000000000000..a69614d327c7
--- /dev/null
+++ b/src/Monitor/MetricsData.Autorest/generated/cmdlets/GetAzMetricsBatch_BatchViaIdentityExpanded.cs
@@ -0,0 +1,670 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.Metric.Cmdlets
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Extensions;
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.PowerShell;
+ using Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Cmdlets;
+ using System;
+
+ /// Lists the metric values for multiple resources.
+ ///
+ /// [OpenAPI] Batch=>POST:"/subscriptions/{subscriptionId}/metrics:getBatch"
+ ///
+ [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMetricsBatch_BatchViaIdentityExpanded", SupportsShouldProcess = true)]
+ [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse))]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Description(@"Lists the metric values for multiple resources.")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Generated]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.HttpPath(Path = "/subscriptions/{subscriptionId}/metrics:getBatch", ApiVersion = "2023-10-01")]
+ public partial class GetAzMetricsBatch_BatchViaIdentityExpanded : global::System.Management.Automation.PSCmdlet,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener,
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IContext
+ {
+ /// A unique id generatd for the this cmdlet when it is instantiated.
+ private string __correlationId = System.Guid.NewGuid().ToString();
+
+ /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)
+ private global::System.Management.Automation.InvocationInfo __invocationInfo;
+
+ /// A unique id generatd for the this cmdlet when ProcessRecord() is called.
+ private string __processRecordId;
+
+ /// The comma separated list of resource IDs to query metrics for.
+ private Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IResourceIdList _batchRequestBody = new Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.ResourceIdList();
+
+ ///
+ /// The for this operation.
+ ///
+ private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource();
+
+ /// A dictionary to carry over additional data for pipeline.
+ private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary();
+
+ /// A buffer to record first returned object in response.
+ private object _firstResponse = null;
+
+ ///
+ /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object.
+ /// Two means multiple returned objects in response.
+ ///
+ private int _responseSize = 0;
+
+ /// Backing field for property.
+ private string _aggregation;
+
+ ///
+ /// The list of aggregation types (comma separated) to retrieve.
+ /// *Examples: average, minimum, maximum*
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of aggregation types (comma separated) to retrieve.\n*Examples: average, minimum, maximum*")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The list of aggregation types (comma separated) to retrieve.
+ *Examples: average, minimum, maximum*",
+ SerializedName = @"aggregation",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Aggregation { get => this._aggregation; set => this._aggregation = value; }
+
+ /// Wait for .NET debugger to attach
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.SwitchParameter Break { get; set; }
+
+ /// Accessor for cancellationTokenSource.
+ public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } }
+
+ /// The reference to the client API class.
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Metric Client => Microsoft.Azure.PowerShell.Cmdlets.Metric.Module.Instance.ClientAPI;
+
+ ///
+ /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet
+ /// against a different subscription
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Azure)]
+ public global::System.Management.Automation.PSObject DefaultProfile { get; set; }
+
+ /// Backing field for property.
+ private string _endTime;
+
+ ///
+ /// The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.",
+ SerializedName = @"endtime",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string EndTime { get => this._endTime; set => this._endTime = value; }
+
+ /// Backing field for property.
+ private string _endpoint;
+
+ ///
+ /// The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match the region
+ /// of the requested resources. For global resources, the region should be 'global'.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match the region of the requested resources. For global resources, the region should be 'global'.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match the region of the requested resources. For global resources, the region should be 'global'.",
+ SerializedName = @"endpoint",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Uri)]
+ public string Endpoint { get => this._endpoint; set => this._endpoint = value; }
+
+ /// Accessor for extensibleParameters.
+ public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; }
+
+ /// Backing field for property.
+ private string _filter;
+
+ ///
+ /// The filter is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. -
+ /// Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’** -
+ /// Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid because the logical
+ /// or operator cannot separate two different metadata names. - Return all time series where A = a1, B = b1 and C = c1: **filter=A
+ /// eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A eq ‘a1’ and B eq ‘*’ and
+ /// C eq ‘*’**.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The filter is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’** - Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1, B = b1 and C = c1: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The filter is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’** - Invalid variant: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’** This is invalid because the logical or operator cannot separate two different metadata names. - Return all time series where A = a1, B = b1 and C = c1: **filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’** - Return all time series where A = a1 **filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.",
+ SerializedName = @"filter",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Filter { get => this._filter; set => this._filter = value; }
+
+ /// SendAsync Pipeline Steps to be appended to the front of the pipeline
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; }
+
+ /// SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity _inputObject;
+
+ /// Identity Parameter
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Path)]
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity InputObject { get => this._inputObject; set => this._inputObject = value; }
+
+ /// Backing field for property.
+ private string _interval;
+
+ ///
+ /// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value
+ /// that returns single datapoint for entire time span requested.
+ /// *Examples: PT15M, PT1H, P1D, FULL*
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested.\n*Examples: PT15M, PT1H, P1D, FULL*")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested.
+ *Examples: PT15M, PT1H, P1D, FULL*",
+ SerializedName = @"interval",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Interval { get => this._interval; set => this._interval = value; }
+
+ /// Accessor for our copy of the InvocationInfo.
+ public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } }
+
+ ///
+ /// cancellation delegate. Stops the cmdlet when called.
+ ///
+ global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel;
+
+ /// cancellation token.
+ global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener.Token => _cancellationTokenSource.Token;
+
+ /// Backing field for property.
+ private System.Collections.Generic.List _name;
+
+ /// The names of the metrics (comma separated) to retrieve.
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The names of the metrics (comma separated) to retrieve.")]
+ [global::System.Management.Automation.AllowEmptyCollection]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"The names of the metrics (comma separated) to retrieve.",
+ SerializedName = @"metricnames",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::System.Management.Automation.Alias("MetricName")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public System.Collections.Generic.List Name { get => this._name; set => this._name = value; }
+
+ /// Backing field for property.
+ private string _namespace;
+
+ /// Metric namespace that contains the requested metric names.
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Metric namespace that contains the requested metric names.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"Metric namespace that contains the requested metric names.",
+ SerializedName = @"metricnamespace",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::System.Management.Automation.Alias("MetricNamespace")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Namespace { get => this._namespace; set => this._namespace = value; }
+
+ /// Backing field for property.
+ private string _orderby;
+
+ ///
+ /// The aggregation to use for sorting results and the direction of the sort.
+ /// Only one order can be specified.
+ /// *Examples: sum asc*
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The aggregation to use for sorting results and the direction of the sort.\nOnly one order can be specified.\n*Examples: sum asc*")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The aggregation to use for sorting results and the direction of the sort.
+ Only one order can be specified.
+ *Examples: sum asc*",
+ SerializedName = @"orderby",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Orderby { get => this._orderby; set => this._orderby = value; }
+
+ ///
+ /// The instance of the that the remote call will use.
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.HttpPipeline Pipeline { get; set; }
+
+ /// The URI for the proxy server to use
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public global::System.Uri Proxy { get; set; }
+
+ /// Credentials for a proxy server to use for the remote call
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.PSCredential ProxyCredential { get; set; }
+
+ /// Use the default credentials for the proxy
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; }
+
+ /// The list of resource IDs to query metrics for.
+ [global::System.Management.Automation.AllowEmptyCollection]
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of resource IDs to query metrics for.")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Body)]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The list of resource IDs to query metrics for.",
+ SerializedName = @"resourceids",
+ PossibleTypes = new [] { typeof(string) })]
+ public string[] ResourceId { get => _batchRequestBody.Resourceid?.ToArray() ?? null /* fixedArrayOf */; set => _batchRequestBody.Resourceid = (value != null ? new System.Collections.Generic.List(value) : null); }
+
+ /// Backing field for property.
+ private string _rollupby;
+
+ ///
+ /// Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq
+ /// Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see
+ /// the results for Seattle and Tacoma rolled up into one timeseries.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.",
+ SerializedName = @"rollupby",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string Rollupby { get => this._rollupby; set => this._rollupby = value; }
+
+ /// Backing field for property.
+ private string _startTime;
+
+ ///
+ /// The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime
+ /// parameter, then this parameter is required.
+ /// If only starttime is specified, then endtime defaults to the current time.
+ /// If no time interval is specified, the default is 1 hour.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime parameter, then this parameter is required.\nIf only starttime is specified, then endtime defaults to the current time.\nIf no time interval is specified, the default is 1 hour.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime parameter, then this parameter is required.
+ If only starttime is specified, then endtime defaults to the current time.
+ If no time interval is specified, the default is 1 hour.",
+ SerializedName = @"starttime",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public string StartTime { get => this._startTime; set => this._startTime = value; }
+
+ /// Backing field for property.
+ private int _top;
+
+ ///
+ /// The maximum number of records to retrieve per resource ID in the request.
+ /// Valid only if filter is specified.
+ /// Defaults to 10.
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum number of records to retrieve per resource ID in the request.\nValid only if filter is specified.\nDefaults to 10.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The maximum number of records to retrieve per resource ID in the request.
+ Valid only if filter is specified.
+ Defaults to 10.",
+ SerializedName = @"top",
+ PossibleTypes = new [] { typeof(int) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.Metric.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Metric.ParameterCategory.Query)]
+ public int Top { get => this._top; set => this._top = value; }
+
+ ///
+ /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what
+ /// happens on that response. Implement this method in a partial class to enable this behavior
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IErrorResponse
+ /// from the remote call
+ /// /// Determines if the rest of the onDefault method should be processed, or if the method should
+ /// return immediately (set to true to skip further processing )
+
+ partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow);
+
+ ///
+ /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens
+ /// on that response. Implement this method in a partial class to enable this behavior
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse
+ /// from the remote call
+ /// /// Determines if the rest of the onOk method should be processed, or if the method should return
+ /// immediately (set to true to skip further processing )
+
+ partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow);
+
+ ///
+ /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet)
+ ///
+ protected override void BeginProcessing()
+ {
+ var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Metric.Module.Instance.GetTelemetryId.Invoke();
+ if (telemetryId != "" && telemetryId != "internal")
+ {
+ __correlationId = telemetryId;
+ }
+ Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials);
+ if (Break)
+ {
+ Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.AttachDebugger.Break();
+ }
+ ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+
+ /// Performs clean-up after the command execution
+ protected override void EndProcessing()
+ {
+ if (1 ==_responseSize)
+ {
+ // Flush buffer
+ WriteObject(_firstResponse);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the