diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.format.ps1xml b/src/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.format.ps1xml index ca90caeacce1..d1ce49b29aae 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.format.ps1xml +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.format.ps1xml @@ -1,40 +1,1914 @@ + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApiKey + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApiKey + + + + + + + + + + + + + + + + + + + + + ApiKey + + + CreatedDate + + + Permissions + + + Description + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApiKeyTableView + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApiKeyTableView + + + + + + + + + + + + + + + + + + + + + ApiKey + + + CreatedDate + + + Permissions + + + Description + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponent + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ResourceGroupName + + + Name + + + Kind + + + Location + + + AppId + + + ApplicationId + + + ApplicationType + + + CreationDate + + + FlowType + + + HockeyAppId + + + HockeyAppToken + + + InstrumentationKey + + + ProvisioningState + + + RequestSource + + + SamplingPercentage + + + TenantId + + + PublicNetworkAccessForIngestion + + + PublicNetworkAccessForQuery + + + ConnectionString + + + RetentionInDays + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentTableView + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentTableView + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ResourceGroupName + + + Name + + + Kind + + + Location + + + AppId + + + ApplicationId + + + ApplicationType + + + CreationDate + + + FlowType + + + HockeyAppId + + + HockeyAppToken + + + InstrumentationKey + + + ProvisioningState + + + RequestSource + + + SamplingPercentage + + + TenantId + + + PublicNetworkAccessForIngestion + + + PublicNetworkAccessForQuery + + + ConnectionString + + + RetentionInDays + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cap + + + ResetTime + + + StopSendNotificationWhenHitCap + + + CapExpirationTime + + + IsCapped + + + ResourceGroupName + + + Name + + + Kind + + + Location + + + AppId + + + ApplicationId + + + ApplicationType + + + CreationDate + + + FlowType + + + HockeyAppId + + + HockeyAppToken + + + InstrumentationKey + + + ProvisioningState + + + RequestSource + + + SamplingPercentage + + + TenantId + + + PublicNetworkAccessForIngestion + + + PublicNetworkAccessForQuery + + + ConnectionString + + + RetentionInDays + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSComponentLinkedStorageAccounts + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSComponentLinkedStorageAccounts + + + + + + + + + + + + + + + Name + + + LinkedStorageAccount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSDailyCap + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSDailyCap + + + + + + + + + + + + + + + + + + Cap + + + ResetTime + + + StopSendNotificationWhenHitCap + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSDailyCapStatus + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSDailyCapStatus + + + + + + + + + + + + + + + ExpirationTime + + + IsCapped + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSExportConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSExportConfiguration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ExportId + + + StorageName + + + ContainerName + + + DocumentTypes + + + DestinationStorageSubscriptionId + + + DestinationStorageLocationId + + + DestinationStorageAccountId + + + IsEnabled + + + ExportStatus + + + LastSuccessTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSExportConfigurationTableView + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSExportConfigurationTableView + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ExportId + + + StorageName + + + ContainerName + + + DocumentTypes + + + DestinationStorageSubscriptionId + + + DestinationStorageLocationId + + + DestinationStorageAccountId + + + IsEnabled + + + ExportStatus + + + LastSuccessTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSPricingPlan + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSPricingPlan + + + + + + + + + + + + + + + + + + Cap + + + ResetTime + + + StopSendNotificationWhenHitCap + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsIdentity - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsIdentity + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsIdentity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AnnotationId + + + ComponentName + + + ExportId + + + KeyId + + + PurgeId + + + ResourceGroupName + + + ResourceName + + + StorageType + + + SubscriptionId + + + WebTestName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ComponentLinkedStorageAccounts + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ComponentLinkedStorageAccounts + + + + + + + + + + + + + + + Name + + + ResourceGroupName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageError + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageError + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties + + + + + + + + + + + + LinkedStorageAccount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent + + + + + + + + + + + + + + + + + + + + + + + + Location + + + Name + + + Etag + + + Kind + + + ResourceGroupName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentListResult + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentProperties + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AppId + + + ApplicationId + + + ApplicationType + + + ConnectionString + + + CreationDate + + + DisableIPMasking + + + DisableLocalAuth + + + FlowType + + + ForceCustomerStorageForProfiler + + + HockeyAppId + + + HockeyAppToken + + + ImmediatePurgeDataOn30Day + + + IngestionMode + + + InstrumentationKey + + + LaMigrationDate + + + Name + + + ProvisioningState + + + PublicNetworkAccessForIngestion + + + PublicNetworkAccessForQuery + + + RequestSource + + + RetentionInDay + + + SamplingPercentage + + + TenantId + + + WorkspaceResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBody + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBody + + + + + + + + + + + + Table + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBodyFilters + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBodyFilters + + + + + + + + + + + + + + + + + + Column + + + Key + + + Operator + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeResponse + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeResponse + + + + + + + + + + + + OperationId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeStatusResponse + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeStatusResponse + + + + + + + + + + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResource + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResource + + + + + + + + + + + + + + + Location + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsError + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsError + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.PrivateLinkScopedResource + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.PrivateLinkScopedResource + + + + + + + + + + + + + + + ResourceId + + + ScopeId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.HeaderField + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.HeaderField + + + + + + + + + + + + + + + Name + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.Operation + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.Operation + + + + + + + + + + + + + + + Name + + + Origin + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.OperationInfo + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.OperationInfo + + + + + + + + + + + + + + + + + + + + + Description + + + Operation + + + Provider + + + Resource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.OperationsListResult + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.OperationsListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.TagsResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.TagsResourceTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTest + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTest + + + + + + + + + + + + + + + + + + + + + Name + + + Location + + + WebTestKind + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestGeolocation + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestGeolocation + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestListResult + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestProperties + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Description + + + Enabled + + + Frequency + + + ProvisioningState + + + RetryEnabled + + + SyntheticMonitorId + + + Timeout + + + WebTestKind + + + WebTestName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesConfiguration + + + + + + + + + + + + WebTest + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesRequest + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesRequest + + + + + + + + + + + + + + + + + + + + + + + + FollowRedirect + + + HttpVerb + + + ParseDependentRequest + + + RequestBody + + + RequestUrl + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesValidationRules + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesValidationRules + + + + + + + + + + + + + + + + + + + + + ExpectedHttpStatusCode + + + IgnoreHttpsStatusCode + + + SslCertRemainingLifetimeCheck + + + SslCheck + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesValidationRulesContentValidation + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesValidationRulesContentValidation + + + + + + + + + + + + + + + + + + ContentMatch + + + IgnoreCase + + + PassIfTextFound + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebtestsResource + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebtestsResource - + - + + + + + + + Location + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebtestsResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebtestsResourceTags + + + - + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.Annotation + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.Annotation + + + + + - + + + + + + + + + + - ComponentName + Category - ResourceGroupName + EventTime - SubscriptionId + Name - WebTestName + Property + + + RelatedAnnotation @@ -42,27 +1916,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.HeaderField + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.AnnotationError - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.HeaderField + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.AnnotationError - + - + - Name + Code - Value + Message @@ -70,27 +1944,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.Operation + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApiKeyRequest - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.Operation + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApiKeyRequest - + - + + + + - Name + LinkedReadProperty - Origin + LinkedWriteProperty + + + Name @@ -98,39 +1978,51 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.OperationInfo + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentApiKey - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.OperationInfo + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentApiKey - + - + - + - + + + + + + + - Description + ApiKey - Operation + CreatedDate - Provider + LinkedReadProperty - Resource + LinkedWriteProperty + + + Name + + + ResourceGroupName @@ -138,21 +2030,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.OperationsListResult + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentBillingFeatures - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.OperationsListResult + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentBillingFeatures - + - NextLink + CurrentBillingFeature @@ -160,21 +2052,51 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.TagsResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCap - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.TagsResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCap - + + + + + + + + + + + + + + + + - Item + Cap + + + MaxHistoryCap + + + ResetTime + + + StopSendNotificationWhenHitCap + + + StopSendNotificationWhenHitThreshold + + + WarningThreshold @@ -182,67 +2104,199 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTest + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportConfiguration - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTest + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportConfiguration - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ApplicationName + + + ContainerName + + + DestinationAccountId + + + DestinationStorageLocationId + + + DestinationStorageSubscriptionId + + + DestinationType + + + ExportId + + + ExportStatus + + + InstrumentationKey + + + IsUserEnabled + + + LastGapTime + + + LastSuccessTime + + + LastUserUpdate + + + NotificationQueueEnabled + + + PermanentErrorReason + + + RecordType + + + ResourceGroup + + + StorageName + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportRequest + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportRequest + + + + + + + + + + + + + + + + + + + + - + - + - + - Name + DestinationAccountId - Location + DestinationAddress - WebTestKind + DestinationStorageLocationId - Enabled + DestinationStorageSubscriptionId - ResourceGroupName + DestinationType - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestGeolocation - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestGeolocation - - - - - - - - - - - Location + IsEnabled + + + NotificationQueueEnabled + + + NotificationQueueUri + + + RecordType @@ -250,21 +2304,63 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestListResult + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeature - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestListResult + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeature - + + + + + + + + + + + + + + + + + + + + + + - NextLink + FeatureName + + + IsHidden + + + IsMainFeature + + + MeterId + + + MeterRateFrequency + + + ResouceId + + + SupportedAddonFeature + + + Title @@ -272,69 +2368,111 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestProperties + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapabilities - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestProperties + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapabilities - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + - Description + AnalyticsIntegration - Enabled + ApiAccessLevel - Frequency + ApplicationMap - ProvisioningState + BurstThrottlePolicy - RetryEnabled + DailyCap - SyntheticMonitorId + DailyCapResetTime - Timeout + LiveStreamMetric - WebTestKind + MetadataClass - WebTestName + MultipleStepWebTest + + + OpenSchema + + + PowerBiIntegration + + + ProactiveDetection + + + SupportExportData + + + ThrottleRate + + + TrackingType + + + WorkItemIntegration @@ -342,21 +2480,51 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesConfiguration + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapability - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesConfiguration + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapability - + + + + + + + + + + + + + + + + - WebTest + Description + + + MeterId + + + MeterRateFrequency + + + Name + + + Unit + + + Value @@ -364,45 +2532,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesRequest + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentQuotaStatus - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesRequest + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentQuotaStatus - - - - - - - + - + - + - FollowRedirect - - - HttpVerb - - - ParseDependentRequest + AppId - RequestBody + ExpirationTime - RequestUrl + ShouldBeThrottled @@ -410,39 +2566,77 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesValidationRules + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ErrorResponse - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesValidationRules + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ErrorResponse - + - + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.InnerError + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.InnerError + + + - + - + - ExpectedHttpStatusCode - - - IgnoreHttpsStatusCode + Diagnosticcontext - SslCertRemainingLifetimeCheck + Time + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationAutoGenerated + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationAutoGenerated + + + + + + + + + + - SslCheck + Name @@ -450,33 +2644,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesValidationRulesContentValidation + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestPropertiesValidationRulesContentValidation + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationDisplay - + - + - + - ContentMatch + Operation - IgnoreCase + Provider - PassIfTextFound + Resource @@ -484,15 +2678,34 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebtestsResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationListResult - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebtestsResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationListResult - + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ProxyResource + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ProxyResource + + + @@ -500,9 +2713,6 @@ - - Location - Name @@ -512,21 +2722,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebtestsResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebtestsResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource - + - Item + Name diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.psm1 b/src/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.psm1 index c2a1eba1f8bb..290d92635c35 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.psm1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.psm1 @@ -25,17 +25,17 @@ } } if(-not $accountsModule) { - $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.2.3' } | Measure-Object).Count -gt 0 + $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.2.3 -Scope Global -PassThru + $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru } } } if(-not $accountsModule) { - Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop - } elseif (($accountsModule.Version -lt [System.Version]'2.2.3') -and (-not $localAccounts)) { - Write-Error "`nThis module requires $accountsName version 2.2.3 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-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.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)'" @@ -50,6 +50,10 @@ # 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 diff --git a/src/ApplicationInsights/ApplicationInsights.Test/Properties/AssemblyInfo.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/Properties/AssemblyInfo.cs similarity index 70% rename from src/ApplicationInsights/ApplicationInsights.Test/Properties/AssemblyInfo.cs rename to src/ApplicationInsights/ApplicationInsights.Autorest/Properties/AssemblyInfo.cs index f85973a6b970..342d34b6b58c 100644 --- a/src/ApplicationInsights/ApplicationInsights.Test/Properties/AssemblyInfo.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,19 +15,14 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using Xunit; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Commands.ApplicationInsights.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Commands.ApplicationInsights.Test")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] +[assembly: AssemblyTitle("Microsoft Azure Powershell - Application Insights Provider")] +[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] +[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] +[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -35,7 +30,7 @@ [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("779954d6-2751-45ba-ad0f-0e30d384c099")] +[assembly: Guid("313dca76-acce-4948-9317-a10f12f2b28c")] // Version information for an assembly consists of the following four values: // @@ -47,6 +42,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.1.0")] -[assembly: AssemblyFileVersion("0.1.0")] -[assembly: CollectionBehavior(DisableTestParallelization = true)] +[assembly: AssemblyVersion("1.3.1")] +[assembly: AssemblyFileVersion("1.3.1")] diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/README.md b/src/ApplicationInsights/ApplicationInsights.Autorest/README.md index 419edef543c0..01a1e7d3cb57 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/README.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/README.md @@ -17,7 +17,7 @@ This directory contains the PowerShell module for the ApplicationInsights servic 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.2.3 or greater +- [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. @@ -36,7 +36,13 @@ require: - $(this-folder)/../../readme.azure.noprofile.md input-file: - $(repo)/specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/webTests_API.json - + - https://github.com/Azure/azure-rest-api-specs/blob/9735d8c1580e6b56e6d4508be6ec00f46e45cb77/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/components_API.json + - https://github.com/Azure/azure-rest-api-specs/blob/e129012901bbd9cc0f182ec5b539bccf2440ef4a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/componentApiKeys_API.json + - https://github.com/Azure/azure-rest-api-specs/blob/8f0d54f788304518eca62ddf281b8c889ad9613c/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/componentAnnotations_API.json + - https://github.com/Azure/azure-rest-api-specs/blob/e129012901bbd9cc0f182ec5b539bccf2440ef4a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/componentFeaturesAndPricing_API.json + - https://github.com/Azure/azure-rest-api-specs/blob/e129012901bbd9cc0f182ec5b539bccf2440ef4a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/componentContinuousExport_API.json + - https://github.com/Azure/azure-rest-api-specs/blob/e129012901bbd9cc0f182ec5b539bccf2440ef4a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/aiOperations_API.json + - https://github.com/Azure/azure-rest-api-specs/blob/88e7838a09868a51de3894114355c75929847a46/specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/componentLinkedStorageAccounts_API.json module-version: 0.1.0 subject-prefix: $(service-name) @@ -45,6 +51,10 @@ resourcegroup-append: true nested-object-to-string: true directive: + - from: swagger-document + where: $.info.title + transform: return "ApplicationInsightsManagementClient" + # Kind 'basic' is not supported on the server. - from: swagger-document where: $.definitions.WebTestProperties.properties.Kind.enum @@ -64,12 +74,123 @@ directive: transform: return $.replace(/providers\/Microsoft.Insights\//g, "providers/microsoft.insights/") - where: - verb: Set + variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ remove: true + # Hide ComponentCurrentBillingFeature related cmdlets - where: - variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ - remove: true + subject: ComponentCurrentBillingFeature|ComponentQuotaStatus + hide: true + + # Rename ExportConfiguration to ContinuousExport + - where: + subject: ExportConfiguration + set: + subject: ContinuousExport + + # Rename parameter 'ResourceName' to 'Name' + - where: + subject: ApiKey + verb: New + parameter-name: Name + set: + parameter-name: Description + - where: + subject: ApiKey|ContinuousExport|Component + parameter-name: ResourceName + set: + parameter-name: Name + alias: + - ApplicationInsightsComponentName + - ComponentName + + # Hide ApplicationInsightsComponent related cmdlets + - where: + subject: Component + verb: Get|New|Clear|Set + hide: true + # Rename Component related cmdlets + - where: + subject: (^Component$)(.*) + set: + subject: $2 + + # Rename parameters for New|Set ApplicationInsightsExportConfiguration + - where: + subject: ContinuousExport + verb: New|Set + parameter-name: DestinationAccountId + set: + parameter-name: StorageAccountId + - where: + subject: ContinuousExport + verb: New|Set + parameter-name: DestinationAddress + set: + parameter-name: StorageSASUri + - where: + subject: ContinuousExport + verb: New|Set + parameter-name: DestinationStorageLocationId + set: + parameter-name: StorageLocation + - where: + subject: ContinuousExport + verb: New|Set + parameter-name: RecordTypes + set: + parameter-name: DocumentType + - where: + subject: ContinuousExport + verb: New|Set + hide: true + + # Rename parameters for ComponentLinkedStorageAccount + - where: + subject: ComponentLinkedStorageAccountAndUpdate + set: + subject: ComponentLinkedStorageAccount + - where: + subject: ComponentLinkedStorageAccount + parameter-name: ResourceName + set: + parameter-name: ComponentName + - where: + subject: ComponentLinkedStorageAccount + parameter-name: LinkedStorageAccount + set: + parameter-name: LinkedStorageAccountResourceId + - where: + subject: ComponentLinkedStorageAccount + set: + subject: LinkedStorageAccount + + # Rename parameter 'KeyId' to 'ApiKeyId' + - where: + subject: ApiKey + verb: Get|Remove + parameter-name: KeyId + set: + parameter-name: ApiKeyId + + # Rename parameter 'InputObject' to 'ApplicationInsightsComponent' + - where: + subject: ApiKey|ContinuousExport + verb: Get|Remove + parameter-name: InputObject + set: + parameter-name: ApplicationInsightsComponent + + # Hide New-AzApplicationInsightsApiKey for customization + - where: + subject: ApiKey + verb: New + hide: true + + # Hide cmdlets + - where: + subject: Annotation|AvailableFeature|FeatureCapability|PurgeStatus|ComponentTag + hide: true # Hide the SyntheticMonitorId parameter because the default value is passed by the server. - where: diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/check-dependencies.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/check-dependencies.ps1 index b02ae9135957..c29591c7bfe1 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/check-dependencies.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/check-dependencies.ps1 @@ -25,7 +25,7 @@ if(-not $Isolated) { 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)) { + 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) { @@ -47,7 +47,7 @@ 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.2.3' +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' diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/create-model-cmdlets.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/create-model-cmdlets.ps1 index 81001b3fc9fa..5c396ba6ffcc 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/create-model-cmdlets.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/create-model-cmdlets.ps1 @@ -23,7 +23,7 @@ function CreateModelCmdlet { } $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models' - $ModuleName = 'Az.ApplicationInsights'.Split(".")[1] + $ModuleName = 'ApplicationInsights' $OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets' $null = New-Item -ItemType Directory -Force -Path $OutputDir @@ -115,7 +115,9 @@ function CreateModelCmdlet { # check whether completer is needed $completer = ''; if($Type.Split('.').Split('.')[-2] -eq 'Support') { - $completer += "`n [ArgumentCompleter([${Type}])]" + # If Type is an array, need to strip [] + $strippedType = $Type.Replace('[]', '') + $completer += "`n [ArgumentCompleter([${strippedType}])]" } $ParameterDefineScript = " [Parameter($ParameterDefineProperty)]${completer} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Get-AzApplicationInsights.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Get-AzApplicationInsights.ps1 new file mode 100644 index 000000000000..edaaf4804c7e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Get-AzApplicationInsights.ps1 @@ -0,0 +1,154 @@ +# ---------------------------------------------------------------------------------- +# 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 +Returns an Application Insights component. +.Description +Returns an Application Insights component. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponent +#> +function Get-AzApplicationInsights { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent], [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan])] + [CmdletBinding(DefaultParameterSetName='ListBySubscription', PositionalBinding=$false)] + param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='ListByResourceGroupName', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + [Alias("ApplicationInsightsComponentName", "ComponentName")] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='ListByResourceGroupName')] + [Parameter(ParameterSetName='ListBySubscription')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetByResourceId', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The resource ID of applicationinsights component. + ${ResourceId}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetByResourceId')] + [Alias("IncludeDailyCap", "IncludeDailyCapStatus", "IncludePricingPlan")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + ${Full}, + + [Parameter(ParameterSetName='GetByInputObject', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + if ($PSBoundParameters.ContainsKey('Full')) { + $full = $PSBoundParameters['Full'] + $null = $PSBoundParameters.Remove('Full') + } + switch ($PSCmdlet.ParameterSetName) { + 'GetByResourceId' { + $resourceId = $PSBoundParameters['ResourceId'] + $null = $PSBoundParameters.Remove('ResourceId') + $component = ($resourceId | . Az.ApplicationInsights.internal\Get-AzApplicationInsightsComponent) + if ($full) { + $pricingPlan = $resourceId | . Az.ApplicationInsights.internal\Get-AzApplicationInsightsComponentCurrentBillingFeature + $dailyCapStatus = $resourceId | . Az.ApplicationInsights.internal\Get-AzApplicationInsightsComponentQuotaStatus + } + break + } + default { + if ($PSBoundParameters['Name']) { + if ($full) { + $pricingPlan = (. Az.ApplicationInsights.internal\Get-AzApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters) + $dailyCapStatus = (. Az.ApplicationInsights.internal\Get-AzApplicationInsightsComponentQuotaStatus @PSBoundParameters) + } + } + $component = (. Az.ApplicationInsights.internal\Get-AzApplicationInsights @PSBoundParameters) + break + } + } + + if ($full) { + $PSCmdlet.WriteObject([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan]::New($component, $pricingPlan, $dailyCapStatus)) + } else { + $PSCmdlet.WriteObject($component) + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights/Models/PSApiKey.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSApiKey.cs similarity index 93% rename from src/ApplicationInsights/ApplicationInsights/Models/PSApiKey.cs rename to src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSApiKey.cs index 79ab4d344548..d780b73a05aa 100644 --- a/src/ApplicationInsights/ApplicationInsights/Models/PSApiKey.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSApiKey.cs @@ -12,13 +12,13 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Linq; using System; +using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501; -namespace Microsoft.Azure.Commands.ApplicationInsights.Models +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { internal class ApiKeyRole { @@ -63,7 +63,7 @@ public class PSApiKey public string Description { get; set; } - public PSApiKey(ApplicationInsightsComponentAPIKey key) + public PSApiKey(ApplicationInsightsComponentApiKey key) { this.ApiKey = key.ApiKey; this.CreatedDate = key.CreatedDate; @@ -78,9 +78,9 @@ public PSApiKey(ApplicationInsightsComponentAPIKey key) ReadAgentConfiguration }; - if (key.LinkedReadProperties != null) + if (key.LinkedReadProperty != null) { - foreach (var readaccess in key.LinkedReadProperties) + foreach (var readaccess in key.LinkedReadProperty) { var role = ExtraRole(roles, readaccess); if (role != null) @@ -90,9 +90,9 @@ public PSApiKey(ApplicationInsightsComponentAPIKey key) } } - if (key.LinkedWriteProperties != null) + if (key.LinkedWriteProperty != null) { - foreach (var writeAccess in key.LinkedWriteProperties) + foreach (var writeAccess in key.LinkedWriteProperty) { var role = ExtraRole(roles, writeAccess); if (role != null) @@ -161,7 +161,7 @@ internal static Tuple BuildApiKeyAccess(string subscriptionI public class PSApiKeyTableView : PSApiKey { - public PSApiKeyTableView(ApplicationInsightsComponentAPIKey key) + public PSApiKeyTableView(ApplicationInsightsComponentApiKey key) : base(key) { } } diff --git a/src/ApplicationInsights/ApplicationInsights/Models/PSApplicationInsightsComponent.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSApplicationInsightsComponent.cs similarity index 90% rename from src/ApplicationInsights/ApplicationInsights/Models/PSApplicationInsightsComponent.cs rename to src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSApplicationInsightsComponent.cs index 22d48fa97e57..0686c675df5c 100644 --- a/src/ApplicationInsights/ApplicationInsights/Models/PSApplicationInsightsComponent.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSApplicationInsightsComponent.cs @@ -12,12 +12,13 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; using System; using System.Collections.Generic; using System.Linq; +using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002; +using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501; -namespace Microsoft.Azure.Commands.ApplicationInsights.Models +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { public class PSApplicationInsightsComponent { @@ -27,7 +28,7 @@ public PSApplicationInsightsComponent(ApplicationInsightsComponent component) this.Name = component.Name; this.Id = component.Id; this.Location = component.Location; - this.Tags = component.Tags; + this.Tags = component.Tag.Keys.ToDictionary(x => x, x => component.Tag[x]); this.Kind = component.Kind; this.Type = component.Type; this.AppId = component.AppId; @@ -44,8 +45,8 @@ public PSApplicationInsightsComponent(ApplicationInsightsComponent component) this.TenantId = component.TenantId; this.PublicNetworkAccessForIngestion = component.PublicNetworkAccessForIngestion; this.PublicNetworkAccessForQuery = component.PublicNetworkAccessForQuery; - this.PrivateLinkScopedResources = component.PrivateLinkScopedResources; - this.RetentionInDays = component.RetentionInDays; + this.PrivateLinkScopedResources = component.PrivateLinkScopedResource.ToList(); + this.RetentionInDays = component.RetentionInDay; this.ConnectionString = component.ConnectionString; } @@ -91,7 +92,7 @@ public PSApplicationInsightsComponent(ApplicationInsightsComponent component) public string PublicNetworkAccessForQuery { get; set; } - public IList PrivateLinkScopedResources { get; private set; } + public IList PrivateLinkScopedResources { get; private set; } public string ConnectionString { get; private set; } @@ -144,13 +145,13 @@ public PSApplicationInsightsComponentWithPricingPlan(ApplicationInsightsComponen ApplicationInsightsComponentQuotaStatus status) : base(component) { - if (billing.CurrentBillingFeatures.Any(f => f.Contains("Enterprise"))) + if (billing.CurrentBillingFeature.Any(f => f.Contains("Enterprise"))) { this.PricingPlan = "Application Insights Enterprise"; } else { - this.PricingPlan = billing.CurrentBillingFeatures.FirstOrDefault(); + this.PricingPlan = billing.CurrentBillingFeature.FirstOrDefault(); } this.Cap = billing.DataVolumeCap.Cap; diff --git a/src/ApplicationInsights/ApplicationInsights/Models/PSComponentLinkedStorageAccounts.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSComponentLinkedStorageAccounts.cs similarity index 95% rename from src/ApplicationInsights/ApplicationInsights/Models/PSComponentLinkedStorageAccounts.cs rename to src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSComponentLinkedStorageAccounts.cs index 574bf1f48f35..24df381a9470 100644 --- a/src/ApplicationInsights/ApplicationInsights/Models/PSComponentLinkedStorageAccounts.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSComponentLinkedStorageAccounts.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -namespace Microsoft.Azure.Commands.ApplicationInsights.Models +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { public class PSComponentLinkedStorageAccounts { diff --git a/src/ApplicationInsights/ApplicationInsights/Models/PSDailyCap.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSDailyCap.cs similarity index 89% rename from src/ApplicationInsights/ApplicationInsights/Models/PSDailyCap.cs rename to src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSDailyCap.cs index dea0a4bf82cc..671376648b90 100644 --- a/src/ApplicationInsights/ApplicationInsights/Models/PSDailyCap.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSDailyCap.cs @@ -12,9 +12,9 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; +using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501; -namespace Microsoft.Azure.Commands.ApplicationInsights.Models +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { public class PSDailyCap { diff --git a/src/ApplicationInsights/ApplicationInsights/Models/PSDailyCapStatus.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSDailyCapStatus.cs similarity index 88% rename from src/ApplicationInsights/ApplicationInsights/Models/PSDailyCapStatus.cs rename to src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSDailyCapStatus.cs index e7e356e2eb61..39698741f28b 100644 --- a/src/ApplicationInsights/ApplicationInsights/Models/PSDailyCapStatus.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSDailyCapStatus.cs @@ -12,9 +12,9 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; +using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501; -namespace Microsoft.Azure.Commands.ApplicationInsights.Models +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { public class PSDailyCapStatus { diff --git a/src/ApplicationInsights/ApplicationInsights/Models/PSExportConfiguration.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSExportConfiguration.cs similarity index 89% rename from src/ApplicationInsights/ApplicationInsights/Models/PSExportConfiguration.cs rename to src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSExportConfiguration.cs index f597eb449bd4..1d483932e41b 100644 --- a/src/ApplicationInsights/ApplicationInsights/Models/PSExportConfiguration.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSExportConfiguration.cs @@ -12,9 +12,9 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; +using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501; -namespace Microsoft.Azure.Commands.ApplicationInsights.Models +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { public class PSExportConfiguration { @@ -33,7 +33,7 @@ public PSExportConfiguration(ApplicationInsightsComponentExportConfiguration res { this.ExportId = response.ExportId; - this.DocumentTypes = string.Join(", ", ApplicationInsightsBaseCmdlet.ConvertToDocumentType(response.RecordTypes.Split(','))); + this.DocumentTypes = string.Join(", ", Utilities.ConvertToDocumentType(response.RecordType.Split(','))); this.DestinationStorageSubscriptionId = response.DestinationStorageSubscriptionId; this.DestinationStorageLocationId = response.DestinationStorageLocationId; this.DestinationStorageAccountId = response.DestinationAccountId; diff --git a/src/ApplicationInsights/ApplicationInsights/Models/PSPrcingPlan.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSPrcingPlan.cs similarity index 84% rename from src/ApplicationInsights/ApplicationInsights/Models/PSPrcingPlan.cs rename to src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSPrcingPlan.cs index 7244e0402681..fc0ff8b3c2e8 100644 --- a/src/ApplicationInsights/ApplicationInsights/Models/PSPrcingPlan.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/PSPrcingPlan.cs @@ -12,10 +12,10 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; using System.Linq; +using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501; -namespace Microsoft.Azure.Commands.ApplicationInsights.Models +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { public class PSPricingPlan : PSDailyCap { @@ -32,13 +32,13 @@ public static PSPricingPlan Create(ApplicationInsightsComponentBillingFeatures b public PSPricingPlan(ApplicationInsightsComponentBillingFeatures billing) : base(billing) { - if (billing.CurrentBillingFeatures.Any(f => f.Contains("Enterprise"))) + if (billing.CurrentBillingFeature.Any(f => f.Contains("Enterprise"))) { this.PricingPlan = "Application Insights Enterprise"; } else { - this.PricingPlan = billing.CurrentBillingFeatures.FirstOrDefault(); + this.PricingPlan = billing.CurrentBillingFeature.FirstOrDefault(); } } } diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/Utilities.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/Utilities.cs new file mode 100644 index 000000000000..4d6a18d21c51 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Models/Utilities.cs @@ -0,0 +1,102 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// 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. +// ---------------------------------------------------------------------------------- + +using System.Collections.Generic; +using System.Linq; +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + public class Utilities + { + internal static string[] ConvertToDocumentType(string[] recordTypes) + { + Dictionary mapping = new Dictionary(); + mapping.Add(RecordTypes.Requests.ToLowerInvariant(), DocumentTypes.Requests); + mapping.Add(RecordTypes.Event.ToLowerInvariant(), DocumentTypes.Event); + mapping.Add(RecordTypes.Exceptions.ToLowerInvariant(), DocumentTypes.Exceptions); + mapping.Add(RecordTypes.Messages.ToLowerInvariant(), DocumentTypes.Messages); + mapping.Add(RecordTypes.Metrics.ToLowerInvariant(), DocumentTypes.Metrics); + mapping.Add(RecordTypes.PageViewPerformance.ToLowerInvariant(), DocumentTypes.PageViewPerformance); + mapping.Add(RecordTypes.PageViews.ToLowerInvariant(), DocumentTypes.PageViews); + mapping.Add(RecordTypes.RemoteDependency.ToLowerInvariant(), DocumentTypes.RemoteDependency); + mapping.Add(RecordTypes.Availability.ToLowerInvariant(), DocumentTypes.Availability); + mapping.Add(RecordTypes.PerformanceCounters.ToLowerInvariant(), DocumentTypes.PerformanceCounters); + + return recordTypes.Select(d => mapping[d.Trim().ToLowerInvariant()]).ToArray(); + } + + public static string ParseSubscriptionFromId(string idFromServer) + { + if (!string.IsNullOrEmpty(idFromServer)) + { + string[] tokens = idFromServer.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + + return tokens[1]; + } + + return null; + } + } + + public class ApplicationType + { + public const string WEB = "web"; + public const string JAVA = "java"; + public const string NodeJs = "Node.js"; + public const string General = "other"; + } + + public class DocumentTypes + { + public const string Requests = "Request"; + public const string Event = "Custom Event"; + public const string Exceptions = "Exception"; + public const string Metrics = "Metric"; + public const string PageViews = "Page View"; + public const string PageViewPerformance = "Page Load"; + public const string RemoteDependency = "Dependency"; + public const string PerformanceCounters = "Performance Counter"; + public const string Availability = "Availability"; + public const string Messages = "Trace"; + } + + internal class RecordTypes + { + public const string Requests = "Requests"; + public const string Event = "Event"; + public const string Exceptions = "Exceptions"; + public const string Metrics = "Metrics"; + public const string PageViews = "PageViews"; + public const string PageViewPerformance = "PageViewPerformance"; + public const string RemoteDependency = "Rdd"; + public const string PerformanceCounters = "PerformanceCounters"; + public const string Availability = "Availability"; + public const string Messages = "Messages"; + } + + public class PermissionType + { + public const string ReadTelemetry = "ReadTelemetry"; + public const string WriteAnnotations = "WriteAnnotations"; + public const string AuthenticateSDKControlChannel = "AuthenticateSDKControlChannel"; + } + + public class PricingPlans + { + public const string Basic = "Basic"; + public const string Enterprise = "Application Insights Enterprise"; + public const string LimitedBasic = "Limited Basic"; + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsights.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsights.ps1 new file mode 100644 index 000000000000..418d07a77e28 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsights.ps1 @@ -0,0 +1,237 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Description +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights +#> +function New-AzApplicationInsights { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] + [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Alias("ApplicationInsightsComponentName", "ComponentName")] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + [Alias("ApplicationKind")] + [ValidateSet("web", "other", "nodejs", "java", "ios", "store", "phone", IgnoreCase)] + # The kind of application that this component refers to, used to customize UI. + # This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. + ${Kind}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource location + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + # Type of application being monitored. + ${ApplicationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable IP masking. + ${DisableIPMasking}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable Non-AAD based Auth. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource etag + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + # Used by the Application Insights system to determine what kind of flow this component was created by. + # This is to be set to 'Bluefield' when creating/updating a component via the REST API. + ${FlowType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Force users to create their own storage account for profiler and debugger. + ${ForceCustomerStorageForProfiler}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + ${HockeyAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Purge data immediately after 30 days. + ${ImmediatePurgeDataOn30Day}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + # Indicates the flow of the ingestion. + ${IngestionMode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights ingestion. + ${PublicNetworkAccessForIngestion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights query. + ${PublicNetworkAccessForQuery}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + # Describes what tool created this Application Insights component. + # Customers using this API should set this to the default 'rest'. + ${RequestSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Retention period in days. + ${RetentionInDays}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + ${SamplingPercentage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Alias("Tags")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource Id of the log analytics workspace which the data will be ingested to. + # This property is required to create an application with this API version. + # Applications from older versions will not have this property. + ${WorkspaceResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + if ($PSBoundParameters.ContainsKey("RetentionInDays")) { + $PSBoundParameters["RetentionInDay"] = $PSBoundParameters["RetentionInDays"] + $null = $PSBoundParameters.Remove("RetentionInDays") + } + if (!$PSBoundParameters.ContainsKey("Kind")) { + $PSBoundParameters["Kind"] = "web" + } + if (!$PSBoundParameters.ContainsKey("ApplicationType")) { + $PSBoundParameters["ApplicationType"] = $PSBoundParameters["Kind"] + } + . Az.ApplicationInsights.internal\New-AzApplicationInsights @PSBoundParameters + } +} + \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsightsApiKey.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsightsApiKey.ps1 new file mode 100644 index 000000000000..eababb48c819 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsightsApiKey.ps1 @@ -0,0 +1,145 @@ +# ---------------------------------------------------------------------------------- +# 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 API Key of an Application Insights component. +.Description +Create an API Key of an Application Insights component. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsapikey +#> +function New-AzApplicationInsightsApiKey { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] + [CmdletBinding(DefaultParameterSetName='ComponentNameParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName="ComponentNameParameterSet")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName="ComponentNameParameterSet", Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName="ComponentNameParameterSet", Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Alias("ApplicationInsightsComponentName", "ComponentName")] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of the API Key. + ${Description}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [ValidateSet("ReadTelemetry", "WriteAnnotations", "AuthenticateSDKControlChannel")] + [System.String[]] + # The read access rights of this API Key. + ${Permissions}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + $pattern = "/subscriptions/$($PSBoundParameters['SubscriptionId'])/resourceGroups/$($PSBoundParameters['ResourceGroupName'])/providers/microsoft.insights/components/$($PSBoundParameters['Name'])/{0}" + $read = @() + $write = @() + + foreach ($permission in $PSBoundParameters['Permissions']) { + switch ($permission) { + "ReadTelemetry" { + $read += [System.String]::Format($pattern, "api") + break + } + "AuthenticateSDKControlChannel" { + $read += [System.String]::Format($pattern, "agentconfig") + break + } + "WriteAnnotations" { + $write += [System.String]::Format($pattern, "annotations") + break + } + default { + break + } + } + } + $null = $PSBoundParameters.Remove('Permissions') + if ($read.Count -ne 0) { + $PSBoundParameters['LinkedReadProperty'] = $read + } + if ($write.Count -ne 0) { + $PSBoundParameters['LinkedWriteProperty'] = $write + } + + . Az.ApplicationInsights.internal\New-AzApplicationInsightsApiKey @PSBoundParameters + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsightsContinuousExport.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsightsContinuousExport.ps1 new file mode 100644 index 000000000000..bc22892edb56 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsightsContinuousExport.ps1 @@ -0,0 +1,153 @@ +# ---------------------------------------------------------------------------------- +# 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 a Continuous Export configuration of an Application Insights component. +.Description +Create a Continuous Export configuration of an Application Insights component. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport +#> +function New-AzApplicationInsightsContinuousExport { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] + [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Alias("ApplicationInsightsComponentName", "ComponentName")] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The Continuous Export destination type. + # This has to be 'Blob'. + ${DestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # The document types to be exported, as comma separated values. + # Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + ${DocumentType }, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of destination storage account. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The location ID of the destination storage container. + ${StorageLocation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The SAS URL for the destination storage container. + # It must grant write permission. + ${StorageSASUri}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + if ($PSBoundParameters['StorageAccountId']) { + $PSBoundParameters['DestinationStorageSubscriptionId'] = [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Utilities]::ParseSubscriptionFromId($PSBoundParameters['StorageAccountId']) + } + $PSBoundParameters['RecordType'] = [System.String]::Join(",", $PSBoundParameters['DocumentType']) + $null = $PSBoundParameters.Remove('DocumentType') + $PSBoundParameters['IsEnabled'] = 'true' + + . Az.ApplicationInsights.internal\New-AzApplicationInsightsContinuousExport @PSBoundParameters + } +} + \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsightsWebTest.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsightsWebTest.ps1 index 8d77c430b4cf..17134d7160af 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsightsWebTest.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/New-AzApplicationInsightsWebTest.ps1 @@ -19,28 +19,6 @@ Creates or updates an Application Insights web test definition. .Description Creates or updates an Application Insights web test definition. -.Example -PS C:\> {{ Add code here }} - -{{ Add output here }} -.Example -PS C:\> {{ Add code here }} - -{{ Add output here }} - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest -.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. - -GEOLOCATION : A list of where to physically run the tests from to give global coverage for accessibility of your application. - [Location ]: Location ID for the WebTest to run from. - -REQUESTHEADER : List of headers and their values to add to the WebTest call. - [Name ]: The name of the header. - [Value ]: The value of the header. .Link https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightswebtest #> diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Set-AzApplicationInsightsContinuousExport.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Set-AzApplicationInsightsContinuousExport.ps1 new file mode 100644 index 000000000000..36ee0fe13778 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Set-AzApplicationInsightsContinuousExport.ps1 @@ -0,0 +1,172 @@ +# ---------------------------------------------------------------------------------- +# 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 a Continuous Export configuration of an Application Insights component. +.Description +Create a Continuous Export configuration of an Application Insights component. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport +#> +function Set-AzApplicationInsightsContinuousExport { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] + [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Alias("ApplicationInsightsComponentName", "ComponentName")] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The Continuous Export configuration ID. + # This is unique within a Application Insights component. + ${ExportId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The Continuous Export destination type. + # This has to be 'Blob'. + ${DestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # The document types to be exported, as comma separated values. + # Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + ${DocumentType }, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of destination storage account. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The location ID of the destination storage container. + ${StorageLocation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + ${DisableConfiguration}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The SAS URL for the destination storage container. + # It must grant write permission. + ${StorageSASUri}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + if ($PSBoundParameters['StorageAccountId']) { + $PSBoundParameters['DestinationStorageSubscriptionId'] = [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Utilities]::ParseSubscriptionFromId($PSBoundParameters['StorageAccountId']) + } + $PSBoundParameters['RecordType'] = [System.String]::Join(",", $PSBoundParameters['DocumentType']) + $null = $PSBoundParameters.Remove('DocumentType') + if ($PSBoundParameters.ContainsKey('DisableConfiguration')) { + if ($PSBoundParameters['DisableConfiguration']) { + $PSBoundParameters['IsEnabled'] = 'false' + } else { + $PSBoundParameters['IsEnabled'] = 'true' + } + $null = $PSBoundParameters.Remove('DisableConfiguration') + } + + . Az.ApplicationInsights.internal\Set-AzApplicationInsightsContinuousExport @PSBoundParameters + } +} + \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Set-AzApplicationInsightsDailyCap.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Set-AzApplicationInsightsDailyCap.ps1 new file mode 100644 index 000000000000..ff4a27654b67 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Set-AzApplicationInsightsDailyCap.ps1 @@ -0,0 +1,132 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Update current billing features for an Application Insights component. +.Description +Update current billing features for an Application Insights component. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightsdailycap +#> +function Set-AzApplicationInsightsDailyCap { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] + [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Alias("ApplicationInsightsComponentName", "ComponentName")] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Daily data volume cap in GB. + ${DailyCapGB}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Stop send notification when hit cap. + ${DisableNotificationWhenHitCap}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + $PSBoundParameters['ResourceName'] = $PSBoundParameters['Name'] + $null = $PSBoundParameters.Remove('Name') + $feature = (. Az.ApplicationInsights.internal\Get-AzApplicationInsightsComponentCurrentBillingFeature -ResourceGroupName $PSBoundParameters['ResourceGroupName'] -SubscriptionId $PSBoundParameters['SubscriptionId'] -ResourceName $PSBoundParameters['ResourceName']) + if ($PSBoundParameters['DailyCapGB']) { + $PSBoundParameters['DataVolumeCap'] = $PSBoundParameters['DailyCapGB'] + $null = $PSBoundParameters.Remove('DailyCapGB') + } + if ($PSBoundParameters.ContainsKey('DisableNotificationWhenHitCap')) { + $PSBoundParameters['DataVolumeCapStopSendNotificationWhenHitCap'] = $PSBoundParameters['DisableNotificationWhenHitCap'] + $PSBoundParameters.Remove('DisableNotificationWhenHitCap') + } else { + $PSBoundParameters['DataVolumeCapStopSendNotificationWhenHitCap'] = $false + } + + $PSBoundParameters['DataVolumeCapStopSendNotificationWhenHitThreshold'] = $feature.DataVolumeCapStopSendNotificationWhenHitThreshold + $PSBoundParameters['DataVolumeCapWarningThreshold'] = $feature.DataVolumeCapWarningThreshold + $PSBoundParameters['CurrentBillingFeature'] = $feature.CurrentBillingFeature + + . Az.ApplicationInsights.internal\Set-AzApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters + } +} + \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Set-AzApplicationInsightsPricingPlan.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Set-AzApplicationInsightsPricingPlan.ps1 new file mode 100644 index 000000000000..efd5b991c024 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Set-AzApplicationInsightsPricingPlan.ps1 @@ -0,0 +1,144 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Update current billing features for an Application Insights component. +.Description +Update current billing features for an Application Insights component. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightspricingplan +#> +function Set-AzApplicationInsightsPricingPlan { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] + [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Alias("ApplicationInsightsComponentName", "ComponentName")] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [ValidateSet("Basic", "Application Insights Enterprise", "Limited Basic")] + [System.String] + # Current enabled pricing plan. + # When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + ${PricingPlan}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Daily data volume cap in GB. + ${DailyCapGB}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Stop send notification when hit cap. + ${DisableNotificationWhenHitCap}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + $PSBoundParameters['ResourceName'] = $PSBoundParameters['Name'] + $null = $PSBoundParameters.Remove('Name') + $feature = (. Az.ApplicationInsights.internal\Get-AzApplicationInsightsComponentCurrentBillingFeature -ResourceGroupName $PSBoundParameters['ResourceGroupName'] -SubscriptionId $PSBoundParameters['SubscriptionId'] -ResourceName $PSBoundParameters['ResourceName']) + if ($PSBoundParameters['PricingPlan']) { + $PSBoundParameters['CurrentBillingFeature'] = @($PSBoundParameters['PricingPlan']) + $null = $PSBoundParameters.Remove('PricingPlan') + } + if ($PSBoundParameters['DailyCapGB']) { + $PSBoundParameters['DataVolumeCap'] = $PSBoundParameters['DailyCapGB'] + $null = $PSBoundParameters.Remove('DailyCapGB') + } + if ($PSBoundParameters.ContainsKey('DisableNotificationWhenHitCap')) { + $PSBoundParameters['DataVolumeCapStopSendNotificationWhenHitCap'] = $PSBoundParameters['DisableNotificationWhenHitCap'] + $PSBoundParameters.Remove('DisableNotificationWhenHitCap') + } else { + $PSBoundParameters['DataVolumeCapStopSendNotificationWhenHitCap'] = $false + } + + $PSBoundParameters['DataVolumeCapStopSendNotificationWhenHitThreshold'] = $feature.DataVolumeCapStopSendNotificationWhenHitThreshold + $PSBoundParameters['DataVolumeCapWarningThreshold'] = $feature.DataVolumeCapWarningThreshold + + . Az.ApplicationInsights.internal\Set-AzApplicationInsightsComponentCurrentBillingFeature @PSBoundParameters + } +} + \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Update-AzApplicationInsights.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Update-AzApplicationInsights.ps1 new file mode 100644 index 000000000000..e5858baa64b5 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/custom/Update-AzApplicationInsights.ps1 @@ -0,0 +1,270 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Description +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights +#> +function Update-AzApplicationInsights { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] + [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Alias("ApplicationInsightsComponentName", "ComponentName")] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + # Type of application being monitored. + ${ApplicationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable IP masking. + ${DisableIPMasking}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable Non-AAD based Auth. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource etag + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + # Used by the Application Insights system to determine what kind of flow this component was created by. + # This is to be set to 'Bluefield' when creating/updating a component via the REST API. + ${FlowType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Force users to create their own storage account for profiler and debugger. + ${ForceCustomerStorageForProfiler}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + ${HockeyAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Purge data immediately after 30 days. + ${ImmediatePurgeDataOn30Day}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + # Indicates the flow of the ingestion. + ${IngestionMode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights ingestion. + ${PublicNetworkAccessForIngestion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights query. + ${PublicNetworkAccessForQuery}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + # Describes what tool created this Application Insights component. + # Customers using this API should set this to the default 'rest'. + ${RequestSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Retention period in days. + ${RetentionInDays}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + ${SamplingPercentage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Alias("Tags")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource Id of the log analytics workspace which the data will be ingested to. + # This property is required to create an application with this API version. + # Applications from older versions will not have this property. + ${WorkspaceResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + try { + $component = . Get-AzApplicationInsights -SubscriptionId $PSBoundParameters["SubscriptionId"] -ResourceGroupName $PSBoundParameters["ResourceGroupName"] -Name $PSBoundParameters["Name"] + } catch { + Write-Warning "component $($PSBoundParameters['Name']) is not existed in Resource Group $($PSBoundParameters["ResourceGroupName"])" + return + } + $PSBoundParameters["Location"] = $component.Location + $PSBoundParameters["Kind"] = $component.Kind + + if (!$PSBoundParameters.ContainsKey("ApplicationType") -and ($null -ne $component.ApplicationType)) { + $PSBoundParameters["ApplicationType"] = $component.ApplicationType + } + if (!$PSBoundParameters.ContainsKey("DisableIPMasking") -and ($null -ne $component.DisableIPMasking)) { + $PSBoundParameters["DisableIPMasking"] = $component.DisableIPMasking + } + if (!$PSBoundParameters.ContainsKey("DisableLocalAuth") -and ($null -ne $component.DisableLocalAuth)) { + $PSBoundParameters["DisableLocalAuth"] = $component.DisableLocalAuth + } + if (!$PSBoundParameters.ContainsKey("Etag") -and ($null -ne $component.Etag)) { + $PSBoundParameters["Etag"] = $component.Etag + } + if (!$PSBoundParameters.ContainsKey("FlowType") -and ($null -ne $component.FlowType)) { + $PSBoundParameters["FlowType"] = $component.FlowType + } + if (!$PSBoundParameters.ContainsKey("ForceCustomerStorageForProfiler") -and ($null -ne $component.ForceCustomerStorageForProfiler)) { + $PSBoundParameters["ForceCustomerStorageForProfiler"] = $component.ForceCustomerStorageForProfiler + } + if (!$PSBoundParameters.ContainsKey("HockeyAppId") -and ($null -ne $component.HockeyAppId)) { + $PSBoundParameters["HockeyAppId"] = $component.HockeyAppId + } + if (!$PSBoundParameters.ContainsKey("ImmediatePurgeDataOn30Day") -and ($null -ne $component.ImmediatePurgeDataOn30Day)) { + $PSBoundParameters["ImmediatePurgeDataOn30Day"] = $component.ImmediatePurgeDataOn30Day + } + if (!$PSBoundParameters.ContainsKey("IngestionMode") -and ($null -ne $component.IngestionMode)) { + $PSBoundParameters["IngestionMode"] = $component.IngestionMode + } + if (!$PSBoundParameters.ContainsKey("PublicNetworkAccessForIngestion") -and ($null -ne $component.PublicNetworkAccessForIngestion)) { + $PSBoundParameters["PublicNetworkAccessForIngestion"] = $component.PublicNetworkAccessForIngestion + } + if (!$PSBoundParameters.ContainsKey("PublicNetworkAccessForQuery") -and ($null -ne $component.PublicNetworkAccessForQuery)) { + $PSBoundParameters["PublicNetworkAccessForQuery"] = $component.PublicNetworkAccessForQuery + } + if (!$PSBoundParameters.ContainsKey("RequestSource") -and ($null -ne $component.RequestSource)) { + $PSBoundParameters["RequestSource"] = $component.RequestSource + } + if (!$PSBoundParameters.ContainsKey("RetentionInDays") -and ($null -ne $component.RetentionInDay)) { + $PSBoundParameters["RetentionInDays"] = $component.RetentionInDay + } + if (!$PSBoundParameters.ContainsKey("SamplingPercentage") -and ($null -ne $component.SamplingPercentage)) { + $PSBoundParameters["SamplingPercentage"] = $component.SamplingPercentage + } + if (!$PSBoundParameters.ContainsKey("Tag") -and ($null -ne $component.Tag)) { + $PSBoundParameters["Tag"] = [System.Collections.Hashtable]$component.Tag.AddtionalProperties + } + if (!$PSBoundParameters.ContainsKey("WorkspaceResourceId") -and ![System.String]::IsNullOrEmpty($component.WorkspaceResourceId)) { + $PSBoundParameters["WorkspaceResourceId"] = $component.WorkspaceResourceId + } + + . New-AzApplicationInsights @PSBoundParameters + } +} + \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Az.ApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Az.ApplicationInsights.md index 764d39ea9638..1164857dd01a 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Az.ApplicationInsights.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Az.ApplicationInsights.md @@ -11,9 +11,34 @@ Locale: en-US Microsoft Azure PowerShell: ApplicationInsights cmdlets ## Az.ApplicationInsights Cmdlets +### [Get-AzApplicationInsights](Get-AzApplicationInsights.md) +Returns an Application Insights component. + +### [Get-AzApplicationInsightsApiKey](Get-AzApplicationInsightsApiKey.md) +Get the API Key for this key id. + +### [Get-AzApplicationInsightsContinuousExport](Get-AzApplicationInsightsContinuousExport.md) +Get the Continuous Export configuration for this export id. + +### [Get-AzApplicationInsightsLinkedStorageAccount](Get-AzApplicationInsightsLinkedStorageAccount.md) +Returns the current linked storage settings for an Application Insights component. + ### [Get-AzApplicationInsightsWebTest](Get-AzApplicationInsightsWebTest.md) Get a specific Application Insights web test definition. +### [New-AzApplicationInsights](New-AzApplicationInsights.md) +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + +### [New-AzApplicationInsightsApiKey](New-AzApplicationInsightsApiKey.md) +Create an API Key of an Application Insights component. + +### [New-AzApplicationInsightsContinuousExport](New-AzApplicationInsightsContinuousExport.md) +Create a Continuous Export configuration of an Application Insights component. + +### [New-AzApplicationInsightsLinkedStorageAccount](New-AzApplicationInsightsLinkedStorageAccount.md) +Replace current linked storage account for an Application Insights component. + ### [New-AzApplicationInsightsWebTest](New-AzApplicationInsightsWebTest.md) Creates or updates an Application Insights web test definition. @@ -23,9 +48,40 @@ Create an in-memory object for WebTestGeolocation. ### [New-AzApplicationInsightsWebTestHeaderFieldObject](New-AzApplicationInsightsWebTestHeaderFieldObject.md) Create a in-memory object for HeaderField +### [Remove-AzApplicationInsights](Remove-AzApplicationInsights.md) +Deletes an Application Insights component. + +### [Remove-AzApplicationInsightsApiKey](Remove-AzApplicationInsightsApiKey.md) +Delete an API Key of an Application Insights component. + +### [Remove-AzApplicationInsightsContinuousExport](Remove-AzApplicationInsightsContinuousExport.md) +Delete a Continuous Export configuration of an Application Insights component. + +### [Remove-AzApplicationInsightsLinkedStorageAccount](Remove-AzApplicationInsightsLinkedStorageAccount.md) +Delete linked storage accounts for an Application Insights component. + ### [Remove-AzApplicationInsightsWebTest](Remove-AzApplicationInsightsWebTest.md) Deletes an Application Insights web test. +### [Set-AzApplicationInsightsContinuousExport](Set-AzApplicationInsightsContinuousExport.md) +Create a Continuous Export configuration of an Application Insights component. + +### [Set-AzApplicationInsightsDailyCap](Set-AzApplicationInsightsDailyCap.md) +Update current billing features for an Application Insights component. + +### [Set-AzApplicationInsightsPricingPlan](Set-AzApplicationInsightsPricingPlan.md) +Update current billing features for an Application Insights component. + +### [Set-AzApplicationInsightsWebTest](Set-AzApplicationInsightsWebTest.md) +Creates or updates an Application Insights web test definition. + +### [Update-AzApplicationInsights](Update-AzApplicationInsights.md) +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + +### [Update-AzApplicationInsightsLinkedStorageAccount](Update-AzApplicationInsightsLinkedStorageAccount.md) +Update linked storage accounts for an Application Insights component. + ### [Update-AzApplicationInsightsWebTestTag](Update-AzApplicationInsightsWebTestTag.md) Creates or updates an Application Insights web test definition. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsights.md new file mode 100644 index 000000000000..6b980ea7e7df --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsights.md @@ -0,0 +1,207 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponent +schema: 2.0.0 +--- + +# Get-AzApplicationInsights + +## SYNOPSIS +Returns an Application Insights component. + +## SYNTAX + +### ListBySubscription (Default) +``` +Get-AzApplicationInsights [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzApplicationInsights -Name -ResourceGroupName [-SubscriptionId ] [-Full] + [-DefaultProfile ] [] +``` + +### GetByInputObject +``` +Get-AzApplicationInsights -InputObject [-DefaultProfile ] + [] +``` + +### GetByResourceId +``` +Get-AzApplicationInsights -ResourceId [-Full] [-DefaultProfile ] [] +``` + +### ListByResourceGroupName +``` +Get-AzApplicationInsights -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Returns an Application Insights component. + +## EXAMPLES + +### Example 1: Get application insights resource +```powershell +Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" +``` + +Get application insights resource + +### Example 2: Get application insights resource with pricing plan information +```powershell +Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePricingPlan +``` + +Get application insights resource with pricing plan information + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Full + + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: Get, GetByResourceId +Aliases: IncludeDailyCap, IncludeDailyCapStatus, IncludePricingPlan + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: GetByInputObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, ListByResourceGroupName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceId +The resource ID of applicationinsights component. + +```yaml +Type: System.String +Parameter Sets: GetByResourceId +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, ListByResourceGroupName, ListBySubscription +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan + +## NOTES + +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsApiKey.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsApiKey.md new file mode 100644 index 000000000000..d83eebdc0934 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsApiKey.md @@ -0,0 +1,181 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsapikey +schema: 2.0.0 +--- + +# Get-AzApplicationInsightsApiKey + +## SYNOPSIS +Get the API Key for this key id. + +## SYNTAX + +### List (Default) +``` +Get-AzApplicationInsightsApiKey -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzApplicationInsightsApiKey -ApiKeyId -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzApplicationInsightsApiKey -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Get the API Key for this key id. + +## EXAMPLES + +### Example 1: Get Api Keys for an application insights resource +```powershell +Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" +``` + +Get Api Keys for an application insights resource + +### Example 2: Get specific API key for an application insights resource +```powershell +Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId 7c4c61dc-b392-4aa4-992f-ee92b84e5dee +``` + +Get specific API key for an application insights resource + +## PARAMETERS + +### -ApiKeyId +The API Key ID. +This is unique within a Application Insights component. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + +## NOTES + +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsContinuousExport.md new file mode 100644 index 000000000000..e7460584b2c4 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsContinuousExport.md @@ -0,0 +1,181 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscontinuousexport +schema: 2.0.0 +--- + +# Get-AzApplicationInsightsContinuousExport + +## SYNOPSIS +Get the Continuous Export configuration for this export id. + +## SYNTAX + +### List (Default) +``` +Get-AzApplicationInsightsContinuousExport -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzApplicationInsightsContinuousExport -ExportId -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzApplicationInsightsContinuousExport -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get the Continuous Export configuration for this export id. + +## EXAMPLES + +### Example 1: Get continuous export for an application insights resource +```powershell +Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" +``` + +Get continuous export for an application insights resource + +### Example 2: Get continuous export for an application insights resource +```powershell +Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "ZJrfffySPdtG3ESn3iRxVIEFuNY=" +``` + +Get continuous export for an application insights resource + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExportId +The Continuous Export configuration ID. +This is unique within a Application Insights component. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + +## NOTES + +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsLinkedStorageAccount.md new file mode 100644 index 000000000000..60152b681a5f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsLinkedStorageAccount.md @@ -0,0 +1,152 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightslinkedstorageaccount +schema: 2.0.0 +--- + +# Get-AzApplicationInsightsLinkedStorageAccount + +## SYNOPSIS +Returns the current linked storage settings for an Application Insights component. + +## SYNTAX + +### Get (Default) +``` +Get-AzApplicationInsightsLinkedStorageAccount -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzApplicationInsightsLinkedStorageAccount -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Returns the current linked storage settings for an Application Insights component. + +## EXAMPLES + +### Example 1: Get linked storage account associated with component "componentName" +```powershell +Get-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName "rgName" -ComponentName "componentName" +``` + +Get linked storage account associated with component "componentName" + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + +## NOTES + +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsWebTest.md index afac2812f0ca..e3754cbb1e3a 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsWebTest.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Get-AzApplicationInsightsWebTest.md @@ -49,8 +49,10 @@ Get a specific Application Insights web test definition. ### Example 1: List all Application Insights web tests under a subscription ```powershell -PS C:\> Get-AzApplicationInsightsWebTest +Get-AzApplicationInsightsWebTest +``` +```output Name Location WebTestKind ResourceGroupName ---- -------- ----------- ----------------- bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test @@ -64,8 +66,10 @@ This command lists all Application Insights web tests under a subscription. ### Example 2: List all Application Insights web tests under a resource group ```powershell -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test +``` +```output Name Location WebTestKind ResourceGroupName ---- -------- ----------- ----------------- bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test @@ -79,12 +83,14 @@ This command lists all Application Insights web tests under a resource group. ### Example 3: List all Application Insights web tests under a specific Application Insights ```powershell -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -AppInsightsName appinsights-portal01 +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -AppInsightsName appinsights-portal01 +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test True -basic-portal02-appinsights-portal01 westus2 ping azpwsh-rg-test True +basic-portal02-appinsights-portal01 westus2 ping azpwsh-rg-test True basic-portal03-appinsights-portal01 westus2 ping azpwsh-rg-test True standard-portal-appinsights-portal01 westus2 standard azpwsh-rg-test True standard-pwsh01 westus2 standard azpwsh-rg-test True @@ -94,8 +100,10 @@ This command lists all Application Insights web tests under a specific Applicati ### Example 4: Get a specific Application Insights web test definition ```powershell -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- standard-pwsh01 westus2 standard azpwsh-rg-test True @@ -105,15 +113,17 @@ This command gets a specific Application Insights web test definition. ### Example 5: Get a specific Application Insights web test definition by pipeline ```powershell -PS C:\> $location01 = New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $location02 = New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroup azpwsh-rg-test -Name standardwebtestpwsh03 -Location 'westus2' ` +$location01 = New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$location02 = New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtestpwsh03 -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} ` --RequestUrl "https://docs.microsoft.com/" -RequestHttpVerb "GET" ` --NameInAppInsights 'standardwebtestpwsh03' ` +-RequestUrl "https://docs.microsoft.com/" -RequestHttpVerb "GET" ` +-TestName 'standardwebtestpwsh03' ` -RuleSslCheck -RuleSslCertRemainingLifetimeCheck 7 -RuleExpectedHttpStatusCode 200 ` --Enabled -Frequency 300 -Timeout 120 -WebTestKind "standard" -RetryEnabled -GeoLocations $location01, $location02 ` |Get-AzApplicationInsightsWebTest +-Enabled -Frequency 300 -Timeout 120 -Kind "standard" -RetryEnabled -GeoLocation $location01, $location02 ` |Get-AzApplicationInsightsWebTest +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- standardwebtestpwsh03 westus2 standard azpwsh-rg-test True @@ -236,9 +246,15 @@ To create the parameters described below, construct a hash table containing the INPUTOBJECT : Identity Parameter + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. - `[SubscriptionId ]`: The ID of the target subscription. - `[WebTestName ]`: The name of the Application Insights WebTest resource. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsights.md new file mode 100644 index 000000000000..506d4e7cb278 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsights.md @@ -0,0 +1,423 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights +schema: 2.0.0 +--- + +# New-AzApplicationInsights + +## SYNOPSIS +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + +## SYNTAX + +``` +New-AzApplicationInsights -Name -ResourceGroupName -Location + [-SubscriptionId ] [-ApplicationType ] [-DisableIPMasking] [-DisableLocalAuth] + [-Etag ] [-FlowType ] [-ForceCustomerStorageForProfiler] [-HockeyAppId ] + [-ImmediatePurgeDataOn30Day] [-IngestionMode ] [-Kind ] + [-PublicNetworkAccessForIngestion ] + [-PublicNetworkAccessForQuery ] [-RequestSource ] + [-RetentionInDays ] [-SamplingPercentage ] [-Tag ] [-WorkspaceResourceId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + +## EXAMPLES + +### Example 1: Create a new application insights resource +```powershell +New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus +``` + +Add a new application insights resource named as "test" in resource group "testgroup" with kind "java" + +## PARAMETERS + +### -ApplicationType +Type of application being monitored. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableIPMasking +Disable IP masking. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableLocalAuth +Disable Non-AAD based Auth. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +Resource etag + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FlowType +Used by the Application Insights system to determine what kind of flow this component was created by. +This is to be set to 'Bluefield' when creating/updating a component via the REST API. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ForceCustomerStorageForProfiler +Force users to create their own storage account for profiler and debugger. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HockeyAppId +The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmediatePurgeDataOn30Day +Purge data immediately after 30 days. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IngestionMode +Indicates the flow of the ingestion. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +The kind of application that this component refers to, used to customize UI. +This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ApplicationKind + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Resource location + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccessForIngestion +The network access type for accessing Application Insights ingestion. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccessForQuery +The network access type for accessing Application Insights query. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestSource +Describes what tool created this Application Insights component. +Customers using this API should set this to the default 'rest'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetentionInDays +Retention period in days. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SamplingPercentage +Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + +```yaml +Type: System.Double +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: Tags + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceResourceId +Resource Id of the log analytics workspace which the data will be ingested to. +This property is required to create an application with this API version. +Applications from older versions will not have this property. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsApiKey.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsApiKey.md new file mode 100644 index 000000000000..7e7ccc4f3aec --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsApiKey.md @@ -0,0 +1,174 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsapikey +schema: 2.0.0 +--- + +# New-AzApplicationInsightsApiKey + +## SYNOPSIS +Create an API Key of an Application Insights component. + +## SYNTAX + +``` +New-AzApplicationInsightsApiKey -Name -ResourceGroupName -Description + -Permissions [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Create an API Key of an Application Insights component. + +## EXAMPLES + +### Example 1: Create a new Api Key for an application insights resource +```powershell +$apiKeyDescription = "testapiKey" +$permissions = @("ReadTelemetry", "WriteAnnotations") +New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Description $apiKeyDescription -Permissions $permissions + +``` + +Create a new Api Key for an application insights resource + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +The name of the API Key. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Permissions +The read access rights of this API Key. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsContinuousExport.md new file mode 100644 index 000000000000..9a30c521b311 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsContinuousExport.md @@ -0,0 +1,255 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport +schema: 2.0.0 +--- + +# New-AzApplicationInsightsContinuousExport + +## SYNOPSIS +Create a Continuous Export configuration of an Application Insights component. + +## SYNTAX + +``` +New-AzApplicationInsightsContinuousExport -Name -ResourceGroupName + [-SubscriptionId ] [-DestinationType ] [-DocumentType ] + [-NotificationQueueEnabled ] [-NotificationQueueUri ] [-StorageAccountId ] + [-StorageLocation ] [-StorageSASUri ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Create a Continuous Export configuration of an Application Insights component. + +## EXAMPLES + +### Example 1: Create a new continuous export configuration for an application insights resource +```powershell +$sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +$sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" ` +-DocumentType "Request","Trace", "Custom Event" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus ` +-StorageSASUri $sasuri +``` + +Create a new application insights continuous export configuration to export "Request" and "Trace" document types to storage contain "testcontainer" in storage account "teststorageaccount" in resource group "testgroup". +The SAS token have to be valid and have write permission to the container, otherwise continuous export feature won't work.If SAS token expired, the continuous export feature will stop working. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationType +The Continuous Export destination type. +This has to be 'Blob'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DocumentType + + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NotificationQueueEnabled +Deprecated + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NotificationQueueUri +Deprecated + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageAccountId +The name of destination storage account. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageLocation +The location ID of the destination storage container. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageSASUri +The SAS URL for the destination storage container. +It must grant write permission. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsLinkedStorageAccount.md new file mode 100644 index 000000000000..ac26028c3198 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsLinkedStorageAccount.md @@ -0,0 +1,157 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightslinkedstorageaccount +schema: 2.0.0 +--- + +# New-AzApplicationInsightsLinkedStorageAccount + +## SYNOPSIS +Replace current linked storage account for an Application Insights component. + +## SYNTAX + +``` +New-AzApplicationInsightsLinkedStorageAccount -Name -ResourceGroupName + [-SubscriptionId ] [-LinkedStorageAccountResourceId ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Replace current linked storage account for an Application Insights component. + +## EXAMPLES + +### Example 1: Create an application insights linked storage account +```powershell +$account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" +Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | New-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id +``` + +Create linked storage account $account under component "componentName" + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LinkedStorageAccountResourceId +Linked storage account resource ID + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTest.md index cde353092804..80d2f36af7ed 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTest.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTest.md @@ -41,14 +41,16 @@ Creates or updates an Application Insights web test definition. ### Example 1: Creates or updates an standard kind of the Application Insights web test ```powershell -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroup azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'standard-pwsh01' ` -RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- standard-pwsh01 westus2 standard azpwsh-rg-test True @@ -60,15 +62,17 @@ We enter hidden-link in the `Tag` parameter to associate WebTest and Application ### Example 2: Creates or updates an ping kind of the Application Insights web test ```powershell -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` -Kind 'ping' -RequestUrl 'https://cn.bing.com' -RequestParseDependent -RuleExpectedHttpStatusCode 200 ` -ContentMatch "status" +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True @@ -78,10 +82,10 @@ This command creates or updates an ping kind of the Application Insights web tes ### Example 3: Creates or updates an ping kind of the Application Insights web test with custom configuration ```powershell -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` -Kind 'ping' ` @@ -100,7 +104,9 @@ PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name " +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTestGeolocationObject.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTestGeolocationObject.md index 5d0fdc701aa0..3f5721723d00 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTestGeolocationObject.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTestGeolocationObject.md @@ -23,8 +23,10 @@ Create an in-memory object for WebTestGeolocation. ### Example 1: Create a in-memory object for WebTestGeolocation ```powershell -PS C:\> New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +``` +```output Location -------- emea-nl-ams-azr diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTestHeaderFieldObject.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTestHeaderFieldObject.md index 74fc62855270..b69213d9c6fe 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTestHeaderFieldObject.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/New-AzApplicationInsightsWebTestHeaderFieldObject.md @@ -23,8 +23,10 @@ Create a in-memory object for HeaderField ### Example 1: Create a in-memory object for HeaderField ```powershell -PS C:\> New-AzApplicationInsightsWebTestHeaderFieldObject -Name 'version' -Value '2.0.1' +New-AzApplicationInsightsWebTestHeaderFieldObject -Name 'version' -Value '2.0.1' +``` +```output Name Value ---- ----- version 2.0.1 diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsights.md new file mode 100644 index 000000000000..4a6f36772684 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsights.md @@ -0,0 +1,198 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsights +schema: 2.0.0 +--- + +# Remove-AzApplicationInsights + +## SYNOPSIS +Deletes an Application Insights component. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzApplicationInsights -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzApplicationInsights -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes an Application Insights component. + +## EXAMPLES + +### Example 1: Remove an application insights resource +```powershell +Remove-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -PassThru +``` + +Remove an application insights resource named "test" in resource group "testgroup" + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsApiKey.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsApiKey.md new file mode 100644 index 000000000000..2dbd39d3b187 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsApiKey.md @@ -0,0 +1,199 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightsapikey +schema: 2.0.0 +--- + +# Remove-AzApplicationInsightsApiKey + +## SYNOPSIS +Delete an API Key of an Application Insights component. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzApplicationInsightsApiKey -ApiKeyId -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzApplicationInsightsApiKey -InputObject [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete an API Key of an Application Insights component. + +## EXAMPLES + +### Example 1: Remove an application insights api key for an application insights resource +```powershell +Remove-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId dd173f38-4fd1-4c75-8af5-99c29aa0f867 -PassThru +``` + +Remove an application insights api key for an application insights resource + +## PARAMETERS + +### -ApiKeyId +The API Key ID. +This is unique within a Application Insights component. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + +## NOTES + +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsContinuousExport.md new file mode 100644 index 000000000000..cde4f71305e2 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsContinuousExport.md @@ -0,0 +1,199 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightscontinuousexport +schema: 2.0.0 +--- + +# Remove-AzApplicationInsightsContinuousExport + +## SYNOPSIS +Delete a Continuous Export configuration of an Application Insights component. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzApplicationInsightsContinuousExport -ExportId -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzApplicationInsightsContinuousExport -InputObject + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a Continuous Export configuration of an Application Insights component. + +## EXAMPLES + +### Example 1: Remove a continuous export configuration in an application insights resource +```powershell +Remove-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "uGOoki0jQsyEs3IdQ83Q4QsNr4=" -PassThru +``` + +Remove a continuous export configuration in an application insights resource + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExportId +The Continuous Export configuration ID. +This is unique within a Application Insights component. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + +## NOTES + +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsLinkedStorageAccount.md new file mode 100644 index 000000000000..74aeec20efcd --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsLinkedStorageAccount.md @@ -0,0 +1,198 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightslinkedstorageaccount +schema: 2.0.0 +--- + +# Remove-AzApplicationInsightsLinkedStorageAccount + +## SYNOPSIS +Delete linked storage accounts for an Application Insights component. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzApplicationInsightsLinkedStorageAccount -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzApplicationInsightsLinkedStorageAccount -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete linked storage accounts for an Application Insights component. + +## EXAMPLES + +### Example 1: Delete linked storage account associated with application insights component "componentName" +```powershell +Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Remove-AzApplicationInsightsLinkedStorageAccount +``` + +Delete linked storage account associated with application insights component "componentName" + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsWebTest.md index ca5a178991d0..b8e3b1a5ff9a 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsWebTest.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Remove-AzApplicationInsightsWebTest.md @@ -31,16 +31,14 @@ Deletes an Application Insights web test. ### Example 1: Deletes an Application Insights web test ```powershell -PS C:\> Remove-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtest01-lucasappinsights - +Remove-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtest01-lucasappinsights ``` This command deletes an Application Insights web test. ### Example 2: Deletes an Application Insights web test by pipeline ```powershell -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights | Remove-AzApplicationInsightsWebTest - +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights | Remove-AzApplicationInsightsWebTest ``` This command deletes an Application Insights web test by pipeline. @@ -191,9 +189,15 @@ To create the parameters described below, construct a hash table containing the INPUTOBJECT : Identity Parameter + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. - `[SubscriptionId ]`: The ID of the target subscription. - `[WebTestName ]`: The name of the Application Insights WebTest resource. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsContinuousExport.md new file mode 100644 index 000000000000..6ce11b35cf94 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsContinuousExport.md @@ -0,0 +1,286 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport +schema: 2.0.0 +--- + +# Set-AzApplicationInsightsContinuousExport + +## SYNOPSIS +Create a Continuous Export configuration of an Application Insights component. + +## SYNTAX + +``` +Set-AzApplicationInsightsContinuousExport -ExportId -Name -ResourceGroupName + [-SubscriptionId ] [-DestinationType ] [-DisableConfiguration] [-DocumentType ] + [-NotificationQueueEnabled ] [-NotificationQueueUri ] [-StorageAccountId ] + [-StorageLocation ] [-StorageSASUri ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Create a Continuous Export configuration of an Application Insights component. + +## EXAMPLES + +### Example 1: Update continuous export configuration +```powershell +$sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +$sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" +-DocumentType "Request","Trace" -ExportId "jlTFEiBg1rkDXOCIeJQ2mB2TxZg=" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus +-StorageSASUri $sasuri +``` + +Update continuous export configuration "jlTFEiBg1rkDXOCIeJQ2mB2TxZg=" of resource "test" in resource group "testgroup" to export "Request" and "Trace" documents to storage container "testcontainer" in "teststorageaccount".The SAS token have to be valid and have write permission to the container, otherwise continuous export feature won't work. +If SAS token expired, the continuous export feature will stop working. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationType +The Continuous Export destination type. +This has to be 'Blob'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableConfiguration + + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DocumentType + + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExportId +The Continuous Export configuration ID. +This is unique within a Application Insights component. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NotificationQueueEnabled +Deprecated + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NotificationQueueUri +Deprecated + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageAccountId +The name of destination storage account. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageLocation +The location ID of the destination storage container. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageSASUri +The SAS URL for the destination storage container. +It must grant write permission. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsDailyCap.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsDailyCap.md new file mode 100644 index 000000000000..360886f1f446 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsDailyCap.md @@ -0,0 +1,171 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightsdailycap +schema: 2.0.0 +--- + +# Set-AzApplicationInsightsDailyCap + +## SYNOPSIS +Update current billing features for an Application Insights component. + +## SYNTAX + +``` +Set-AzApplicationInsightsDailyCap -Name -ResourceGroupName [-SubscriptionId ] + [-DailyCapGB ] [-DisableNotificationWhenHitCap] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Update current billing features for an Application Insights component. + +## EXAMPLES + +### Example 1: Set daily data volume cap for an application insights resource +```powershell +Set-AzApplicationInsightsDailyCap -ResourceGroupName "testgroup" -Name "test" -DailyCapGB 400 -DisableNotificationWhenHitCap +``` + +Set the daily data volume cap to 400GB per day and stop send notification when hit cap for resource "test" in resource group "testgroup" + +## PARAMETERS + +### -DailyCapGB +Daily data volume cap in GB. + +```yaml +Type: System.Double +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableNotificationWhenHitCap +Stop send notification when hit cap. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsPricingPlan.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsPricingPlan.md new file mode 100644 index 000000000000..6d474d783311 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsPricingPlan.md @@ -0,0 +1,187 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightspricingplan +schema: 2.0.0 +--- + +# Set-AzApplicationInsightsPricingPlan + +## SYNOPSIS +Update current billing features for an Application Insights component. + +## SYNTAX + +``` +Set-AzApplicationInsightsPricingPlan -Name -ResourceGroupName [-SubscriptionId ] + [-DailyCapGB ] [-DisableNotificationWhenHitCap] [-PricingPlan ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update current billing features for an Application Insights component. + +## EXAMPLES + +### Example 1: Set pricing plan and daily data volume information for an application insights resource +```powershell +Set-AzApplicationInsightsPricingPlan -ResourceGroupName "testgroup" -Name "test" -PricingPlan "Basic" -DailyCapGB 400 +``` + +Set the pricing plan to "Basic", set the daily data volume cap to 400GB per day and stop send notification when hit cap for resource "test" in resource group "testgroup" + +## PARAMETERS + +### -DailyCapGB +Daily data volume cap in GB. + +```yaml +Type: System.Double +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableNotificationWhenHitCap +Stop send notification when hit cap. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PricingPlan +Current enabled pricing plan. +When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsWebTest.md new file mode 100644 index 000000000000..befb1ef8a35b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Set-AzApplicationInsightsWebTest.md @@ -0,0 +1,570 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightswebtest +schema: 2.0.0 +--- + +# Set-AzApplicationInsightsWebTest + +## SYNOPSIS +Creates or updates an Application Insights web test definition. + +## SYNTAX + +``` +Set-AzApplicationInsightsWebTest -Name -ResourceGroupName -Location + [-SubscriptionId ] [-ConfigurationWebTest ] [-ContentValidationContentMatch ] + [-ContentValidationIgnoreCase] [-ContentValidationPassIfTextFound] [-Description ] [-Enabled] + [-Frequency ] [-Kind ] [-PropertiesLocations ] + [-PropertiesWebTestName ] [-RequestBody ] [-RequestFollowRedirect] + [-RequestHeader ] [-RequestHttpVerb ] [-RequestParseDependentRequest] + [-RequestUrl ] [-RetryEnabled] [-SyntheticMonitorId ] [-Tag ] [-Timeout ] + [-ValidationRuleExpectedHttpStatusCode ] [-ValidationRuleIgnoreHttpsStatusCode] + [-ValidationRuleSslCertRemainingLifetimeCheck ] [-ValidationRuleSslCheck] + [-WebTestKind ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates an Application Insights web test definition. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} + +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} + +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ConfigurationWebTest +The XML specification of a WebTest to run against an application. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContentValidationContentMatch +Content to look for in the return of the WebTest. +Must not be null or empty. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContentValidationIgnoreCase +When set, this value makes the ContentMatch validation case insensitive. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContentValidationPassIfTextFound +When true, validation will pass if there is a match for the ContentMatch string. +If false, validation will fail if there is a match + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +User defined description for this WebTest. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Enabled +Is the test actively being monitored. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Frequency +Interval in seconds between test runs for this WebTest. +Default value is 300. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +The kind of WebTest that this web test watches. +Choices are ping and multistep. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Resource location + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights WebTest resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: WebTestName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesLocations +A list of where to physically run the tests from to give global coverage for accessibility of your application. +To construct, see NOTES section for PROPERTIESLOCATIONS properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesWebTestName +User defined name if this WebTest. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestBody +Base64 encoded string body to send with this web test. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestFollowRedirect +Follow redirects for this web test. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestHeader +List of headers and their values to add to the WebTest call. +To construct, see NOTES section for REQUESTHEADER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestHttpVerb +Http verb to use for this web test. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestParseDependentRequest +Parse Dependent request for this WebTest. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestUrl +Url location to test. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryEnabled +Allow for retries should this WebTest fail. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SyntheticMonitorId +Unique ID of this WebTest. +This is typically the same value as the Name field. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Timeout +Seconds until this WebTest will timeout and fail. +Default value is 30. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ValidationRuleExpectedHttpStatusCode +Validate that the WebTest returns the http status code provided. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ValidationRuleIgnoreHttpsStatusCode +When set, validation will ignore the status code. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ValidationRuleSslCertRemainingLifetimeCheck +A number of days to check still remain before the the existing SSL cert expires. +Value must be positive and the SSLCheck must be set to true. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ValidationRuleSslCheck +Checks to see if the SSL cert is still valid. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WebTestKind +The kind of web test this is, valid choices are ping, multistep, and standard. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest + +## NOTES + +ALIASES + +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. + + +PROPERTIESLOCATIONS : A list of where to physically run the tests from to give global coverage for accessibility of your application. + - `[Location ]`: Location ID for the WebTest to run from. + +REQUESTHEADER : List of headers and their values to add to the WebTest call. + - `[Name ]`: The name of the header. + - `[Value ]`: The value of the header. + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Update-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Update-AzApplicationInsights.md new file mode 100644 index 000000000000..4775fcfb96ed --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Update-AzApplicationInsights.md @@ -0,0 +1,392 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights +schema: 2.0.0 +--- + +# Update-AzApplicationInsights + +## SYNOPSIS +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + +## SYNTAX + +``` +Update-AzApplicationInsights -Name -ResourceGroupName [-SubscriptionId ] + [-ApplicationType ] [-DisableIPMasking] [-DisableLocalAuth] [-Etag ] + [-FlowType ] [-ForceCustomerStorageForProfiler] [-HockeyAppId ] + [-ImmediatePurgeDataOn30Day] [-IngestionMode ] + [-PublicNetworkAccessForIngestion ] + [-PublicNetworkAccessForQuery ] [-RequestSource ] + [-RetentionInDays ] [-SamplingPercentage ] [-Tag ] [-WorkspaceResourceId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. + +## EXAMPLES + +### Example 1: Update application insights component +```powershell +Update-AzApplicationInsights -ResourceGroupName "rgName" -Name "aiName" -PublicNetworkAccessForIngestion "Disabled" -PublicNetworkAccessForQuery "Disabled" +``` + +update application insights component "aiName" PublicNetworkAccessForIngestion/PublicNetworkAccessForQuery both to "Disabled" + +## PARAMETERS + +### -ApplicationType +Type of application being monitored. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableIPMasking +Disable IP masking. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableLocalAuth +Disable Non-AAD based Auth. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +Resource etag + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FlowType +Used by the Application Insights system to determine what kind of flow this component was created by. +This is to be set to 'Bluefield' when creating/updating a component via the REST API. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ForceCustomerStorageForProfiler +Force users to create their own storage account for profiler and debugger. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HockeyAppId +The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmediatePurgeDataOn30Day +Purge data immediately after 30 days. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IngestionMode +Indicates the flow of the ingestion. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccessForIngestion +The network access type for accessing Application Insights ingestion. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccessForQuery +The network access type for accessing Application Insights query. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestSource +Describes what tool created this Application Insights component. +Customers using this API should set this to the default 'rest'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetentionInDays +Retention period in days. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SamplingPercentage +Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + +```yaml +Type: System.Double +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: Tags + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceResourceId +Resource Id of the log analytics workspace which the data will be ingested to. +This property is required to create an application with this API version. +Applications from older versions will not have this property. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Update-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Update-AzApplicationInsightsLinkedStorageAccount.md new file mode 100644 index 000000000000..28dfec21cac1 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Update-AzApplicationInsightsLinkedStorageAccount.md @@ -0,0 +1,201 @@ +--- +external help file: +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightslinkedstorageaccount +schema: 2.0.0 +--- + +# Update-AzApplicationInsightsLinkedStorageAccount + +## SYNOPSIS +Update linked storage accounts for an Application Insights component. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzApplicationInsightsLinkedStorageAccount -Name -ResourceGroupName + [-SubscriptionId ] [-LinkedStorageAccountResourceId ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzApplicationInsightsLinkedStorageAccount -InputObject + [-LinkedStorageAccountResourceId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Update linked storage accounts for an Application Insights component. + +## EXAMPLES + +### Example 1: Update linked storage account +```powershell +$account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" +Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Update-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id +``` + +Update linked storage account under component "componentName" to associate with $account + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LinkedStorageAccountResourceId +Linked storage account resource ID + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: ApplicationInsightsComponentName, ComponentName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + +## NOTES + +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + +## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Update-AzApplicationInsightsWebTestTag.md b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Update-AzApplicationInsightsWebTestTag.md index 8c6e4e315a57..a0eb467557d9 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Update-AzApplicationInsightsWebTestTag.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/docs/Update-AzApplicationInsightsWebTestTag.md @@ -31,8 +31,10 @@ Creates or updates an Application Insights web test definition. ### Example 1: Updates Application Insights link of the Web test ```powershell -PS C:\> Update-AzApplicationInsightsWebTestTag -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/lucasappinsights" = "Resource"} +Update-AzApplicationInsightsWebTestTag -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/lucasappinsights" = "Resource"} +``` +```output Location Name WebTestKind ResourceGroupName Enabled -------- ---- ----------- ----------------- ------- westus2 webtest01-lucasappinsights standard azpwsh-rg-test True @@ -42,8 +44,10 @@ This command updates Application Insights link of the Web test. ### Example 2: Updates Application Insights link of the Web test by pipeline ```powershell -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -WebTestName webtest01-lucasappinsights | Update-AzApplicationInsightsWebTestTag -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -WebTestName webtest01-lucasappinsights | Update-AzApplicationInsightsWebTestTag -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} +``` +```output Location Name WebTestKind ResourceGroupName Enabled -------- ---- ----------- ----------------- ------- westus2 webtest01-lucasappinsights standard azpwsh-rg-test True @@ -197,9 +201,15 @@ To create the parameters described below, construct a hash table containing the INPUTOBJECT : Identity Parameter + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. - `[SubscriptionId ]`: The ID of the target subscription. - `[WebTestName ]`: The name of the Application Insights WebTest resource. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsights.md new file mode 100644 index 000000000000..97e1289f1999 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsights.md @@ -0,0 +1,14 @@ +### Example 1: Get application insights resource +```powershell +Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" +``` + +Get application insights resource + +### Example 2: Get application insights resource with pricing plan information +```powershell +Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePricingPlan +``` + +Get application insights resource with pricing plan information + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsApiKey.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsApiKey.md new file mode 100644 index 000000000000..2b83b8b53ae5 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsApiKey.md @@ -0,0 +1,14 @@ +### Example 1: Get Api Keys for an application insights resource +```powershell +Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" +``` + +Get Api Keys for an application insights resource + +### Example 2: Get specific API key for an application insights resource +```powershell +Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId 7c4c61dc-b392-4aa4-992f-ee92b84e5dee +``` + +Get specific API key for an application insights resource + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsContinuousExport.md new file mode 100644 index 000000000000..aaac918a2523 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsContinuousExport.md @@ -0,0 +1,14 @@ +### Example 1: Get continuous export for an application insights resource +```powershell +Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" +``` + +Get continuous export for an application insights resource + +### Example 2: Get continuous export for an application insights resource +```powershell +Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "ZJrfffySPdtG3ESn3iRxVIEFuNY=" +``` + +Get continuous export for an application insights resource + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsLinkedStorageAccount.md new file mode 100644 index 000000000000..23f5a399a625 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsLinkedStorageAccount.md @@ -0,0 +1,7 @@ +### Example 1: Get linked storage account associated with component "componentName" +```powershell +Get-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName "rgName" -ComponentName "componentName" +``` + +Get linked storage account associated with component "componentName" + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsWebTest.md index 5046109245e5..045f3492507e 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsWebTest.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Get-AzApplicationInsightsWebTest.md @@ -1,7 +1,8 @@ ### Example 1: List all Application Insights web tests under a subscription ```powershell -PS C:\> Get-AzApplicationInsightsWebTest - +Get-AzApplicationInsightsWebTest +``` +```output Name Location WebTestKind ResourceGroupName ---- -------- ----------- ----------------- bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test @@ -15,8 +16,9 @@ This command lists all Application Insights web tests under a subscription. ### Example 2: List all Application Insights web tests under a resource group ```powershell -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test - +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test +``` +```output Name Location WebTestKind ResourceGroupName ---- -------- ----------- ----------------- bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test @@ -30,12 +32,13 @@ This command lists all Application Insights web tests under a resource group. ### Example 3: List all Application Insights web tests under a specific Application Insights ```powershell -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -AppInsightsName appinsights-portal01 - +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -AppInsightsName appinsights-portal01 +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test True -basic-portal02-appinsights-portal01 westus2 ping azpwsh-rg-test True +basic-portal02-appinsights-portal01 westus2 ping azpwsh-rg-test True basic-portal03-appinsights-portal01 westus2 ping azpwsh-rg-test True standard-portal-appinsights-portal01 westus2 standard azpwsh-rg-test True standard-pwsh01 westus2 standard azpwsh-rg-test True @@ -45,8 +48,9 @@ This command lists all Application Insights web tests under a specific Applicati ### Example 4: Get a specific Application Insights web test definition ```powershell -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 - +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- standard-pwsh01 westus2 standard azpwsh-rg-test True @@ -56,15 +60,16 @@ This command gets a specific Application Insights web test definition. ### Example 5: Get a specific Application Insights web test definition by pipeline ```powershell -PS C:\> $location01 = New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $location02 = New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroup azpwsh-rg-test -Name standardwebtestpwsh03 -Location 'westus2' ` +$location01 = New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$location02 = New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtestpwsh03 -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} ` --RequestUrl "https://docs.microsoft.com/" -RequestHttpVerb "GET" ` --NameInAppInsights 'standardwebtestpwsh03' ` +-RequestUrl "https://docs.microsoft.com/" -RequestHttpVerb "GET" ` +-TestName 'standardwebtestpwsh03' ` -RuleSslCheck -RuleSslCertRemainingLifetimeCheck 7 -RuleExpectedHttpStatusCode 200 ` --Enabled -Frequency 300 -Timeout 120 -WebTestKind "standard" -RetryEnabled -GeoLocations $location01, $location02 ` |Get-AzApplicationInsightsWebTest - +-Enabled -Frequency 300 -Timeout 120 -Kind "standard" -RetryEnabled -GeoLocation $location01, $location02 ` |Get-AzApplicationInsightsWebTest +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- standardwebtestpwsh03 westus2 standard azpwsh-rg-test True diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsights.md new file mode 100644 index 000000000000..2089b628641a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsights.md @@ -0,0 +1,6 @@ +### Example 1: Create a new application insights resource +```powershell +New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus +``` + +Add a new application insights resource named as "test" in resource group "testgroup" with kind "java" \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsApiKey.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsApiKey.md new file mode 100644 index 000000000000..3112103d943f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsApiKey.md @@ -0,0 +1,10 @@ +### Example 1: Create a new Api Key for an application insights resource +```powershell +$apiKeyDescription = "testapiKey" +$permissions = @("ReadTelemetry", "WriteAnnotations") +New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Description $apiKeyDescription -Permissions $permissions + +``` + +Create a new Api Key for an application insights resource + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsContinuousExport.md new file mode 100644 index 000000000000..44b4810141cd --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsContinuousExport.md @@ -0,0 +1,10 @@ +### Example 1: Create a new continuous export configuration for an application insights resource +```powershell +$sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +$sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" ` +-DocumentType "Request","Trace", "Custom Event" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus ` +-StorageSASUri $sasuri +``` + +Create a new application insights continuous export configuration to export "Request" and "Trace" document types to storage contain "testcontainer" in storage account "teststorageaccount" in resource group "testgroup". The SAS token have to be valid and have write permission to the container, otherwise continuous export feature won't work.If SAS token expired, the continuous export feature will stop working. \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsLinkedStorageAccount.md new file mode 100644 index 000000000000..c620e423414e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsLinkedStorageAccount.md @@ -0,0 +1,8 @@ +### Example 1: Create an application insights linked storage account +```powershell +$account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" +Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | New-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id +``` + +Create linked storage account $account under component "componentName" + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTest.md index 7f2c6b7d5645..70477cea48e9 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTest.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTest.md @@ -1,13 +1,14 @@ ### Example 1: Creates or updates an standard kind of the Application Insights web test ```powershell -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroup azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'standard-pwsh01' ` -RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation - +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- standard-pwsh01 westus2 standard azpwsh-rg-test True @@ -19,15 +20,16 @@ We enter hidden-link in the `Tag` parameter to associate WebTest and Application ### Example 2: Creates or updates an ping kind of the Application Insights web test ```powershell -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` -Kind 'ping' -RequestUrl 'https://cn.bing.com' -RequestParseDependent -RuleExpectedHttpStatusCode 200 ` -ContentMatch "status" - +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True @@ -37,10 +39,10 @@ This command creates or updates an ping kind of the Application Insights web tes ### Example 3: Creates or updates an ping kind of the Application Insights web test with custom configuration ```powershell -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` -Kind 'ping' ` @@ -59,7 +61,8 @@ PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name " - +``` +```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTestGeolocationObject.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTestGeolocationObject.md index bf6887d021ed..7a83d5bc9ddc 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTestGeolocationObject.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTestGeolocationObject.md @@ -1,7 +1,8 @@ ### Example 1: Create a in-memory object for WebTestGeolocation ```powershell -PS C:\> New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" - +New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +``` +```output Location -------- emea-nl-ams-azr diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTestHeaderFieldObject.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTestHeaderFieldObject.md index 96515a9b68aa..0e0c4c6afe20 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTestHeaderFieldObject.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/New-AzApplicationInsightsWebTestHeaderFieldObject.md @@ -1,7 +1,8 @@ ### Example 1: Create a in-memory object for HeaderField ```powershell -PS C:\> New-AzApplicationInsightsWebTestHeaderFieldObject -Name 'version' -Value '2.0.1' - +New-AzApplicationInsightsWebTestHeaderFieldObject -Name 'version' -Value '2.0.1' +``` +```output Name Value ---- ----- version 2.0.1 diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsights.md new file mode 100644 index 000000000000..5a7a6f1cada6 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsights.md @@ -0,0 +1,6 @@ +### Example 1: Remove an application insights resource +```powershell +Remove-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -PassThru +``` + +Remove an application insights resource named "test" in resource group "testgroup" \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsApiKey.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsApiKey.md new file mode 100644 index 000000000000..86ca0b390fee --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsApiKey.md @@ -0,0 +1,6 @@ +### Example 1: Remove an application insights api key for an application insights resource +```powershell +Remove-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId dd173f38-4fd1-4c75-8af5-99c29aa0f867 -PassThru +``` + +Remove an application insights api key for an application insights resource \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsContinuousExport.md new file mode 100644 index 000000000000..d84d8ebedf04 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsContinuousExport.md @@ -0,0 +1,7 @@ +### Example 1: Remove a continuous export configuration in an application insights resource +```powershell +Remove-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "uGOoki0jQsyEs3IdQ83Q4QsNr4=" -PassThru +``` + +Remove a continuous export configuration in an application insights resource + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsLinkedStorageAccount.md new file mode 100644 index 000000000000..0479ed0f5c3d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsLinkedStorageAccount.md @@ -0,0 +1,6 @@ +### Example 1: Delete linked storage account associated with application insights component "componentName" +```powershell +Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Remove-AzApplicationInsightsLinkedStorageAccount +``` + +Delete linked storage account associated with application insights component "componentName" \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsWebTest.md index 37eb91582be3..7ed15f72dd51 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsWebTest.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Remove-AzApplicationInsightsWebTest.md @@ -1,15 +1,13 @@ ### Example 1: Deletes an Application Insights web test ```powershell -PS C:\> Remove-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtest01-lucasappinsights - +Remove-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtest01-lucasappinsights ``` This command deletes an Application Insights web test. ### Example 2: Deletes an Application Insights web test by pipeline ```powershell -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights | Remove-AzApplicationInsightsWebTest - +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights | Remove-AzApplicationInsightsWebTest ``` This command deletes an Application Insights web test by pipeline. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsContinuousExport.md new file mode 100644 index 000000000000..500e5b7d3deb --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsContinuousExport.md @@ -0,0 +1,10 @@ +### Example 1: Update continuous export configuration +```powershell +$sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +$sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" +-DocumentType "Request","Trace" -ExportId "jlTFEiBg1rkDXOCIeJQ2mB2TxZg=" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus +-StorageSASUri $sasuri +``` + +Update continuous export configuration "jlTFEiBg1rkDXOCIeJQ2mB2TxZg=" of resource "test" in resource group "testgroup" to export "Request" and "Trace" documents to storage container "testcontainer" in "teststorageaccount".The SAS token have to be valid and have write permission to the container, otherwise continuous export feature won't work. If SAS token expired, the continuous export feature will stop working. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsDailyCap.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsDailyCap.md new file mode 100644 index 000000000000..107ac0ba893b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsDailyCap.md @@ -0,0 +1,7 @@ +### Example 1: Set daily data volume cap for an application insights resource +```powershell +Set-AzApplicationInsightsDailyCap -ResourceGroupName "testgroup" -Name "test" -DailyCapGB 400 -DisableNotificationWhenHitCap +``` + +Set the daily data volume cap to 400GB per day and stop send notification when hit cap for resource "test" in resource group "testgroup" + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsPricingPlan.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsPricingPlan.md new file mode 100644 index 000000000000..a37f0e511bcd --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsPricingPlan.md @@ -0,0 +1,6 @@ +### Example 1: Set pricing plan and daily data volume information for an application insights resource +```powershell +Set-AzApplicationInsightsPricingPlan -ResourceGroupName "testgroup" -Name "test" -PricingPlan "Basic" -DailyCapGB 400 +``` + +Set the pricing plan to "Basic", set the daily data volume cap to 400GB per day and stop send notification when hit cap for resource "test" in resource group "testgroup" \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsWebTest.md new file mode 100644 index 000000000000..20380d0c8753 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Set-AzApplicationInsightsWebTest.md @@ -0,0 +1,18 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} + +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} + +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Update-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Update-AzApplicationInsights.md new file mode 100644 index 000000000000..2eb48ac68db8 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Update-AzApplicationInsights.md @@ -0,0 +1,7 @@ +### Example 1: Update application insights component +```powershell +Update-AzApplicationInsights -ResourceGroupName "rgName" -Name "aiName" -PublicNetworkAccessForIngestion "Disabled" -PublicNetworkAccessForQuery "Disabled" +``` + +update application insights component "aiName" PublicNetworkAccessForIngestion/PublicNetworkAccessForQuery both to "Disabled" + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Update-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Update-AzApplicationInsightsLinkedStorageAccount.md new file mode 100644 index 000000000000..2cc161cb06fa --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Update-AzApplicationInsightsLinkedStorageAccount.md @@ -0,0 +1,8 @@ +### Example 1: Update linked storage account +```powershell +$account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" +Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Update-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id +``` + +Update linked storage account under component "componentName" to associate with $account + diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Update-AzApplicationInsightsWebTestTag.md b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Update-AzApplicationInsightsWebTestTag.md index c33d0c47a3dd..7598cb82ce6a 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Update-AzApplicationInsightsWebTestTag.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/examples/Update-AzApplicationInsightsWebTestTag.md @@ -1,8 +1,9 @@ ### Example 1: Updates Application Insights link of the Web test [Update-AzApplicationInsightsWebTestTag API Swgger](https://github.com/Azure/azure-rest-api-specs/blob/master/specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2018-05-01-preview/webTests_API.json#L189) ```powershell -PS C:\> Update-AzApplicationInsightsWebTestTag -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/lucasappinsights" = "Resource"} - +Update-AzApplicationInsightsWebTestTag -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/lucasappinsights" = "Resource"} +``` +```output Location Name WebTestKind ResourceGroupName Enabled -------- ---- ----------- ----------------- ------- westus2 webtest01-lucasappinsights standard azpwsh-rg-test True @@ -12,8 +13,9 @@ This command updates Application Insights link of the Web test. ### Example 2: Updates Application Insights link of the Web test by pipeline ```powershell -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -WebTestName webtest01-lucasappinsights | Update-AzApplicationInsightsWebTestTag -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} - +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -WebTestName webtest01-lucasappinsights | Update-AzApplicationInsightsWebTestTag -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} +``` +```output Location Name WebTestKind ResourceGroupName Enabled -------- ---- ----------- ----------------- ------- westus2 webtest01-lucasappinsights standard azpwsh-rg-test True diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsights.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsights.ps1 new file mode 100644 index 000000000000..93a44eb6c974 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsights.ps1 @@ -0,0 +1,228 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Returns an Application Insights component. +.Description +Returns an Application Insights component. +.Example +PS C:\> Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" +.Example +PS C:\> Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePricingPlan + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponent +#> +function Get-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent], [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan])] +[CmdletBinding(DefaultParameterSetName='ListBySubscription', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='ListBySubscription')] + [Parameter(ParameterSetName='ListByResourceGroupName')] + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ListByResourceGroupName', Mandatory)] + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='GetByResourceId', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The resource ID of applicationinsights component. + ${ResourceId}, + + [Parameter(ParameterSetName='GetByInputObject', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetByResourceId')] + [Alias('IncludeDailyCap', 'IncludeDailyCapStatus', 'IncludePricingPlan')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + ${Full}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + ListBySubscription = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; + ListByResourceGroupName = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; + Get = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; + GetByResourceId = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; + GetByInputObject = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; + } + if (('ListBySubscription', 'ListByResourceGroupName', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsApiKey.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsApiKey.ps1 new file mode 100644 index 000000000000..b5f5a000a782 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsApiKey.ps1 @@ -0,0 +1,218 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Get the API Key for this key id. +.Description +Get the API Key for this key id. +.Example +PS C:\> Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" +.Example +PS C:\> Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId 7c4c61dc-b392-4aa4-992f-ee92b84e5dee + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsapikey +#> +function Get-AzApplicationInsightsApiKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The API Key ID. + # This is unique within a Application Insights component. + ${ApiKeyId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_GetViaIdentity'; + List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsContinuousExport.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsContinuousExport.ps1 new file mode 100644 index 000000000000..87f35ad5a555 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsContinuousExport.ps1 @@ -0,0 +1,218 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Get the Continuous Export configuration for this export id. +.Description +Get the Continuous Export configuration for this export id. +.Example +PS C:\> Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" +.Example +PS C:\> Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "ZJrfffySPdtG3ESn3iRxVIEFuNY=" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscontinuousexport +#> +function Get-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The Continuous Export configuration ID. + # This is unique within a Application Insights component. + ${ExportId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_GetViaIdentity'; + List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsLinkedStorageAccount.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsLinkedStorageAccount.ps1 new file mode 100644 index 000000000000..9d1a57309602 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsLinkedStorageAccount.ps1 @@ -0,0 +1,205 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Returns the current linked storage settings for an Application Insights component. +.Description +Returns the current linked storage settings for an Application Insights component. +.Example +PS C:\> Get-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName "rgName" -ComponentName "componentName" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightslinkedstorageaccount +#> +function Get-AzApplicationInsightsLinkedStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsLinkedStorageAccount_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsLinkedStorageAccount_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWebTest.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWebTest.ps1 index 240501776ee8..b1c538c493ee 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWebTest.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWebTest.ps1 @@ -20,54 +20,22 @@ Get a specific Application Insights web test definition. .Description Get a specific Application Insights web test definition. .Example -PS C:\> Get-AzApplicationInsightsWebTest - -Name Location WebTestKind ResourceGroupName ----- -------- ----------- ----------------- -bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test -basic-portal02-appinsights-portal01 westus2 ping azpwsh-rg-test -basic-portal03-appinsights-portal01 westus2 ping azpwsh-rg-test -standard-portal-appinsights-portal01 westus2 standard azpwsh-rg-test -standard-pwsh01 westus2 standard azpwsh-rg-test +Get-AzApplicationInsightsWebTest .Example -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test - -Name Location WebTestKind ResourceGroupName ----- -------- ----------- ----------------- -bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test -basic-portal02-appinsights-portal01 westus2 ping azpwsh-rg-test -basic-portal03-appinsights-portal01 westus2 ping azpwsh-rg-test -standard-portal-appinsights-portal01 westus2 standard azpwsh-rg-test -standard-pwsh01 westus2 standard azpwsh-rg-test +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test .Example -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -AppInsightsName appinsights-portal01 - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test True -basic-portal02-appinsights-portal01 westus2 ping azpwsh-rg-test True -basic-portal03-appinsights-portal01 westus2 ping azpwsh-rg-test True -standard-portal-appinsights-portal01 westus2 standard azpwsh-rg-test True -standard-pwsh01 westus2 standard azpwsh-rg-test True +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -AppInsightsName appinsights-portal01 .Example -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -standard-pwsh01 westus2 standard azpwsh-rg-test True +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 .Example -PS C:\> $location01 = New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $location02 = New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroup azpwsh-rg-test -Name standardwebtestpwsh03 -Location 'westus2' ` +$location01 = New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$location02 = New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtestpwsh03 -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} ` --RequestUrl "https://docs.microsoft.com/" -RequestHttpVerb "GET" ` --NameInAppInsights 'standardwebtestpwsh03' ` +-RequestUrl "https://docs.microsoft.com/" -RequestHttpVerb "GET" ` +-TestName 'standardwebtestpwsh03' ` -RuleSslCheck -RuleSslCertRemainingLifetimeCheck 7 -RuleExpectedHttpStatusCode 200 ` --Enabled -Frequency 300 -Timeout 120 -WebTestKind "standard" -RetryEnabled -GeoLocations $location01, $location02 ` |Get-AzApplicationInsightsWebTest - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -standardwebtestpwsh03 westus2 standard azpwsh-rg-test True +-Enabled -Frequency 300 -Timeout 120 -Kind "standard" -RetryEnabled -GeoLocation $location01, $location02 ` |Get-AzApplicationInsightsWebTest .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity @@ -79,9 +47,15 @@ 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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. [SubscriptionId ]: The ID of the target subscription. [WebTestName ]: The name of the Application Insights WebTest resource. .Link @@ -185,6 +159,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_GetViaIdentity'; @@ -202,6 +194,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -210,15 +203,32 @@ 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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsights.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsights.ps1 new file mode 100644 index 000000000000..b9e778a445dd --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsights.ps1 @@ -0,0 +1,266 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Description +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Example +PS C:\> New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights +#> +function New-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource location + ${Location}, + + [Parameter()] + [Alias('ApplicationKind')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The kind of application that this component refers to, used to customize UI. + # This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. + ${Kind}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + # Type of application being monitored. + ${ApplicationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable IP masking. + ${DisableIPMasking}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable Non-AAD based Auth. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource etag + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + # Used by the Application Insights system to determine what kind of flow this component was created by. + # This is to be set to 'Bluefield' when creating/updating a component via the REST API. + ${FlowType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Force users to create their own storage account for profiler and debugger. + ${ForceCustomerStorageForProfiler}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + ${HockeyAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Purge data immediately after 30 days. + ${ImmediatePurgeDataOn30Day}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + # Indicates the flow of the ingestion. + ${IngestionMode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights ingestion. + ${PublicNetworkAccessForIngestion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights query. + ${PublicNetworkAccessForQuery}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + # Describes what tool created this Application Insights component. + # Customers using this API should set this to the default 'rest'. + ${RequestSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Retention period in days. + ${RetentionInDays}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + ${SamplingPercentage}, + + [Parameter()] + [Alias('Tags')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource Id of the log analytics workspace which the data will be ingested to. + # This property is required to create an application with this API version. + # Applications from older versions will not have this property. + ${WorkspaceResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + $mapping = @{ + __AllParameterSets = 'Az.ApplicationInsights.custom\New-AzApplicationInsights'; + } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + throw + } +} + +end { + try { + $steppablePipeline.End() + } catch { + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsApiKey.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsApiKey.ps1 new file mode 100644 index 000000000000..b84150ae81c6 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsApiKey.ps1 @@ -0,0 +1,194 @@ + +# ---------------------------------------------------------------------------------- +# 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 API Key of an Application Insights component. +.Description +Create an API Key of an Application Insights component. +.Example +PS C:\> $apiKeyDescription = "testapiKey" +PS C:\> $permissions = @("ReadTelemetry", "WriteAnnotations") +PS C:\> New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Description $apiKeyDescription -Permissions $permissions + + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsapikey +#> +function New-AzApplicationInsightsApiKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[CmdletBinding(DefaultParameterSetName='ComponentNameParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of the API Key. + ${Description}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # The read access rights of this API Key. + ${Permissions}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + ComponentNameParameterSet = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsApiKey'; + } + if (('ComponentNameParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsContinuousExport.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsContinuousExport.ps1 new file mode 100644 index 000000000000..50c736cf153d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsContinuousExport.ps1 @@ -0,0 +1,225 @@ + +# ---------------------------------------------------------------------------------- +# 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 a Continuous Export configuration of an Application Insights component. +.Description +Create a Continuous Export configuration of an Application Insights component. +.Example +PS C:\> $sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +PS C:\> $sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +PS C:\> New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" ` +-DocumentType "Request","Trace", "Custom Event" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus ` +-StorageSASUri $sasuri + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport +#> +function New-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The Continuous Export destination type. + # This has to be 'Blob'. + ${DestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + ${DocumentType }, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of destination storage account. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The location ID of the destination storage container. + ${StorageLocation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The SAS URL for the destination storage container. + # It must grant write permission. + ${StorageSASUri}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + CreateExpanded = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsContinuousExport'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsLinkedStorageAccount.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsLinkedStorageAccount.ps1 new file mode 100644 index 000000000000..f32af5fc5540 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsLinkedStorageAccount.ps1 @@ -0,0 +1,185 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Replace current linked storage account for an Application Insights component. +.Description +Replace current linked storage account for an Application Insights component. +.Example +PS C:\> $account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" +PS C:\> Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | New-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightslinkedstorageaccount +#> +function New-AzApplicationInsightsLinkedStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Linked storage account resource ID + ${LinkedStorageAccountResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsLinkedStorageAccount_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTest.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTest.ps1 index 34bb768e94e9..c60bd62e4812 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTest.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTest.ps1 @@ -20,35 +20,27 @@ Creates or updates an Application Insights web test definition. .Description Creates or updates an Application Insights web test definition. .Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroup azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'standard-pwsh01' ` -RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -standard-pwsh01 westus2 standard azpwsh-rg-test True .Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` -Kind 'ping' -RequestUrl 'https://cn.bing.com' -RequestParseDependent -RuleExpectedHttpStatusCode 200 ` -ContentMatch "status" - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True .Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` -Kind 'ping' ` @@ -68,10 +60,6 @@ PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name " -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True - .Outputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest .Notes @@ -323,6 +311,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ CreateStandard = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTest'; CreateClassic = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTest'; @@ -337,6 +343,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -345,15 +352,32 @@ 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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestGeolocationObject.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestGeolocationObject.ps1 index af0bcda528d8..21198098e6e5 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestGeolocationObject.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestGeolocationObject.ps1 @@ -20,11 +20,7 @@ Create an in-memory object for WebTestGeolocation. .Description Create an in-memory object for WebTestGeolocation. .Example -PS C:\> New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" - -Location --------- -emea-nl-ams-azr +New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" .Outputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestGeolocation @@ -49,6 +45,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ __AllParameterSets = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTestGeolocationObject'; } @@ -59,6 +73,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -67,15 +82,32 @@ 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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestHeaderFieldObject.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestHeaderFieldObject.ps1 index a60ceb8759d8..358bc5710c32 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestHeaderFieldObject.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestHeaderFieldObject.ps1 @@ -20,11 +20,7 @@ Create a in-memory object for HeaderField .Description Create a in-memory object for HeaderField .Example -PS C:\> New-AzApplicationInsightsWebTestHeaderFieldObject -Name 'version' -Value '2.0.1' - -Name Value ----- ----- -version 2.0.1 +New-AzApplicationInsightsWebTestHeaderFieldObject -Name 'version' -Value '2.0.1' .Outputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.HeaderField @@ -55,6 +51,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ __AllParameterSets = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTestHeaderFieldObject'; } @@ -65,6 +79,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -73,15 +88,32 @@ 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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/ProxyCmdletDefinitions.ps1 index 0b6dfb181e3c..e15dc4514114 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -16,91 +16,59 @@ <# .Synopsis -Get a specific Application Insights web test definition. +Get the API Key for this key id. .Description -Get a specific Application Insights web test definition. -.Example -PS C:\> Get-AzApplicationInsightsWebTest - -Name Location WebTestKind ResourceGroupName ----- -------- ----------- ----------------- -bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test -basic-portal02-appinsights-portal01 westus2 ping azpwsh-rg-test -basic-portal03-appinsights-portal01 westus2 ping azpwsh-rg-test -standard-portal-appinsights-portal01 westus2 standard azpwsh-rg-test -standard-pwsh01 westus2 standard azpwsh-rg-test -.Example -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test - -Name Location WebTestKind ResourceGroupName ----- -------- ----------- ----------------- -bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test -basic-portal02-appinsights-portal01 westus2 ping azpwsh-rg-test -basic-portal03-appinsights-portal01 westus2 ping azpwsh-rg-test -standard-portal-appinsights-portal01 westus2 standard azpwsh-rg-test -standard-pwsh01 westus2 standard azpwsh-rg-test +Get the API Key for this key id. .Example -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -AppInsightsName appinsights-portal01 - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -bsaic-portal-appinsights-portal01 westus2 ping azpwsh-rg-test True -basic-portal02-appinsights-portal01 westus2 ping azpwsh-rg-test True -basic-portal03-appinsights-portal01 westus2 ping azpwsh-rg-test True -standard-portal-appinsights-portal01 westus2 standard azpwsh-rg-test True -standard-pwsh01 westus2 standard azpwsh-rg-test True +PS C:\> Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" .Example -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -standard-pwsh01 westus2 standard azpwsh-rg-test True -.Example -PS C:\> $location01 = New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $location02 = New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroup azpwsh-rg-test -Name standardwebtestpwsh03 -Location 'westus2' ` --Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} ` --RequestUrl "https://docs.microsoft.com/" -RequestHttpVerb "GET" ` --NameInAppInsights 'standardwebtestpwsh03' ` --RuleSslCheck -RuleSslCertRemainingLifetimeCheck 7 -RuleExpectedHttpStatusCode 200 ` --Enabled -Frequency 300 -Timeout 120 -WebTestKind "standard" -RetryEnabled -GeoLocations $location01, $location02 ` |Get-AzApplicationInsightsWebTest - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -standardwebtestpwsh03 westus2 standard azpwsh-rg-test True +PS C:\> Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId 7c4c61dc-b392-4aa4-992f-ee92b84e5dee .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey .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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. [SubscriptionId ]: The ID of the target subscription. [WebTestName ]: The name of the Application Insights WebTest resource. .Link -https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightswebtest +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsapikey #> -function Get-AzApplicationInsightsWebTest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest])] -[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +function Get-AzApplicationInsightsApiKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('WebTestName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] - # The name of the Application Insights WebTest resource. + # The API Key ID. + # This is unique within a Application Insights component. + ${ApiKeyId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. ${Name}, [Parameter(ParameterSetName='Get', Mandatory)] [Parameter(ParameterSetName='List', Mandatory)] - [Parameter(ParameterSetName='List2', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -109,8 +77,6 @@ param( [Parameter(ParameterSetName='Get')] [Parameter(ParameterSetName='List')] - [Parameter(ParameterSetName='List1')] - [Parameter(ParameterSetName='List2')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String[]] @@ -124,12 +90,6 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='List2', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] - [System.String] - # The name of the Application Insights component resource. - ${AppInsightsName}, - [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -185,14 +145,30 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ - Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_Get'; - GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_GetViaIdentity'; - List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_List'; - List1 = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_List1'; - List2 = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_List2'; + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_GetViaIdentity'; + List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_List'; } - if (('Get', 'List', 'List1', 'List2') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -202,6 +178,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -210,75 +187,106 @@ 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.ApplicationInsights.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 } -} +} } <# .Synopsis -Deletes an Application Insights web test. +Get the Continuous Export configuration for this export id. .Description -Deletes an Application Insights web test. +Get the Continuous Export configuration for this export id. .Example -PS C:\> Remove-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtest01-lucasappinsights - +PS C:\> Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" .Example -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights | Remove-AzApplicationInsightsWebTest - +PS C:\> Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "ZJrfffySPdtG3ESn3iRxVIEFuNY=" .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -System.Boolean +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration .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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. [SubscriptionId ]: The ID of the target subscription. [WebTestName ]: The name of the Application Insights WebTest resource. .Link -https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightswebtest +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscontinuousexport #> -function Remove-AzApplicationInsightsWebTest { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Get-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('WebTestName')] + [Parameter(ParameterSetName='Get', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] - # The name of the Application Insights WebTest resource. + # The Continuous Export configuration ID. + # This is unique within a Application Insights component. + ${ExportId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. ${Name}, - [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='Delete')] + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] + [System.String[]] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] # Identity Parameter @@ -313,12 +321,6 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] [System.Uri] @@ -346,11 +348,30 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ - Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWebTest_Delete'; - DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWebTest_DeleteViaIdentity'; + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_GetViaIdentity'; + List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_List'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -360,6 +381,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -368,93 +390,100 @@ 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.ApplicationInsights.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 } -} +} } <# .Synopsis -Creates or updates an Application Insights web test definition. +Returns the current linked storage settings for an Application Insights component. .Description -Creates or updates an Application Insights web test definition. -.Example -PS C:\> Update-AzApplicationInsightsWebTestTag -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/lucasappinsights" = "Resource"} - -Location Name WebTestKind ResourceGroupName Enabled --------- ---- ----------- ----------------- ------- -westus2 webtest01-lucasappinsights standard azpwsh-rg-test True +Returns the current linked storage settings for an Application Insights component. .Example -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -WebTestName webtest01-lucasappinsights | Update-AzApplicationInsightsWebTestTag -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} - -Location Name WebTestKind ResourceGroupName Enabled --------- ---- ----------- ----------------- ------- -westus2 webtest01-lucasappinsights standard azpwsh-rg-test True +PS C:\> Get-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName "rgName" -ComponentName "componentName" .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts .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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. [SubscriptionId ]: The ID of the target subscription. [WebTestName ]: The name of the Application Insights WebTest resource. .Link -https://docs.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightswebtesttag +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightslinkedstorageaccount #> -function Update-AzApplicationInsightsWebTestTag { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Get-AzApplicationInsightsLinkedStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] - # The name of the Application Insights WebTest resource. + # The name of the Application Insights component resource. ${Name}, - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='Get', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='Get')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] + [System.String[]] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags]))] - [System.Collections.Hashtable] - # Resource tags - ${Tag}, - [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -510,11 +539,29 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ - UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded'; + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsLinkedStorageAccount_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsLinkedStorageAccount_GetViaIdentity'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -524,6 +571,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -532,77 +580,61 @@ 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.ApplicationInsights.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 } -} +} } <# .Synopsis -Creates or updates an Application Insights web test definition. +Get a specific Application Insights web test definition. .Description -Creates or updates an Application Insights web test definition. +Get a specific Application Insights web test definition. .Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroup azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` --Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` --RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'standard-pwsh01' ` --RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -standard-pwsh01 westus2 standard azpwsh-rg-test True +Get-AzApplicationInsightsWebTest .Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` --Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` --GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` --Kind 'ping' -RequestUrl 'https://cn.bing.com' -RequestParseDependent -RuleExpectedHttpStatusCode 200 ` --ContentMatch "status" - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test .Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` --Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` --GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` --Kind 'ping' ` --Configuration " - - - - - - - - - - - - - -" - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -AppInsightsName appinsights-portal01 +.Example +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 +.Example +$location01 = New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$location02 = New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtestpwsh03 -Location 'westus2' ` +-Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} ` +-RequestUrl "https://docs.microsoft.com/" -RequestHttpVerb "GET" ` +-TestName 'standardwebtestpwsh03' ` +-RuleSslCheck -RuleSslCertRemainingLifetimeCheck 7 -RuleExpectedHttpStatusCode 200 ` +-Enabled -Frequency 300 -Timeout 120 -Kind "standard" -RetryEnabled -GeoLocation $location01, $location02 ` |Get-AzApplicationInsightsWebTest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest .Notes @@ -610,194 +642,3996 @@ 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. -GEOLOCATION : A list of where to physically run the tests from to give global coverage for accessibility of your application. - [Location ]: Location ID for the WebTest to run from. - -REQUESTHEADER : List of headers and their values to add to the WebTest call. - [Name ]: The name of the header. - [Value ]: The value of the header. +INPUTOBJECT : Identity Parameter + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. .Link -https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightswebtest +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightswebtest #> -function New-AzApplicationInsightsWebTest { +function Get-AzApplicationInsightsWebTest { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest])] -[CmdletBinding(DefaultParameterSetName='CreateStandard', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='Get', Mandatory)] [Alias('WebTestName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the Application Insights WebTest resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List2', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Parameter(ParameterSetName='List2')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] + [System.String[]] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # Resource location - ${Location}, - - [Parameter(ParameterSetName='CreateStandard')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # When set, this value makes the ContentMatch validation case insensitive. - ${ContentIgnoreCase}, + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Parameter(ParameterSetName='List2', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] - # Content to look for in the return of the WebTest. - # Must not be null or empty. - ${ContentMatch}, - - [Parameter(ParameterSetName='CreateStandard')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # When true, validation will pass if there is a match for the ContentMatch string. - # If false, validation will fail if there is a match - ${ContentPassIfTextFound}, + # The name of the Application Insights component resource. + ${AppInsightsName}, [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # User defined description for this WebTest. - ${Description}, + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_GetViaIdentity'; + List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_List'; + List1 = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_List1'; + List2 = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWebTest_List2'; + } + if (('Get', 'List', 'List1', 'List2') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Replace current linked storage account for an Application Insights component. +.Description +Replace current linked storage account for an Application Insights component. +.Example +PS C:\> $account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" +PS C:\> Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | New-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightslinkedstorageaccount +#> +function New-AzApplicationInsightsLinkedStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Linked storage account resource ID + ${LinkedStorageAccountResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsLinkedStorageAccount_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Delete an API Key of an Application Insights component. +.Description +Delete an API Key of an Application Insights component. +.Example +PS C:\> Remove-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId dd173f38-4fd1-4c75-8af5-99c29aa0f867 -PassThru + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightsapikey +#> +function Remove-AzApplicationInsightsApiKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The API Key ID. + # This is unique within a Application Insights component. + ${ApiKeyId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsApiKey_Delete'; + DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsApiKey_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Delete a Continuous Export configuration of an Application Insights component. +.Description +Delete a Continuous Export configuration of an Application Insights component. +.Example +PS C:\> Remove-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "uGOoki0jQsyEs3IdQ83Q4QsNr4=" -PassThru + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightscontinuousexport +#> +function Remove-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The Continuous Export configuration ID. + # This is unique within a Application Insights component. + ${ExportId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsContinuousExport_Delete'; + DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsContinuousExport_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Delete linked storage accounts for an Application Insights component. +.Description +Delete linked storage accounts for an Application Insights component. +.Example +PS C:\> Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Remove-AzApplicationInsightsLinkedStorageAccount + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +System.Boolean +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightslinkedstorageaccount +#> +function Remove-AzApplicationInsightsLinkedStorageAccount { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsLinkedStorageAccount_Delete'; + DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Deletes an Application Insights web test. +.Description +Deletes an Application Insights web test. +.Example +Remove-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtest01-lucasappinsights +.Example +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights | Remove-AzApplicationInsightsWebTest + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +System.Boolean +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightswebtest +#> +function Remove-AzApplicationInsightsWebTest { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('WebTestName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights WebTest resource. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWebTest_Delete'; + DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWebTest_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Deletes an Application Insights component. +.Description +Deletes an Application Insights component. +.Example +PS C:\> Remove-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -PassThru + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +System.Boolean +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsights +#> +function Remove-AzApplicationInsights { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsights_Delete'; + DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsights_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Creates or updates an Application Insights web test definition. +.Description +Creates or updates an Application Insights web test definition. +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest +.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. + +PROPERTIESLOCATIONS : A list of where to physically run the tests from to give global coverage for accessibility of your application. + [Location ]: Location ID for the WebTest to run from. + +REQUESTHEADER : List of headers and their values to add to the WebTest call. + [Name ]: The name of the header. + [Value ]: The value of the header. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightswebtest +#> +function Set-AzApplicationInsightsWebTest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('WebTestName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights WebTest resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource location + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The XML specification of a WebTest to run against an application. + ${ConfigurationWebTest}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Content to look for in the return of the WebTest. + # Must not be null or empty. + ${ContentValidationContentMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When set, this value makes the ContentMatch validation case insensitive. + ${ContentValidationIgnoreCase}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When true, validation will pass if there is a match for the ContentMatch string. + # If false, validation will fail if there is a match + ${ContentValidationPassIfTextFound}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # User defined description for this WebTest. + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Is the test actively being monitored. + ${Enabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Interval in seconds between test runs for this WebTest. + # Default value is 300. + ${Frequency}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind] + # The kind of WebTest that this web test watches. + # Choices are ping and multistep. + ${Kind}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation[]] + # A list of where to physically run the tests from to give global coverage for accessibility of your application. + # To construct, see NOTES section for PROPERTIESLOCATIONS properties and create a hash table. + ${PropertiesLocations}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # User defined name if this WebTest. + ${PropertiesWebTestName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Base64 encoded string body to send with this web test. + ${RequestBody}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Follow redirects for this web test. + ${RequestFollowRedirect}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField[]] + # List of headers and their values to add to the WebTest call. + # To construct, see NOTES section for REQUESTHEADER properties and create a hash table. + ${RequestHeader}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Http verb to use for this web test. + ${RequestHttpVerb}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Parse Dependent request for this WebTest. + ${RequestParseDependentRequest}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Url location to test. + ${RequestUrl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow for retries should this WebTest fail. + ${RetryEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Unique ID of this WebTest. + # This is typically the same value as the Name field. + ${SyntheticMonitorId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Seconds until this WebTest will timeout and fail. + # Default value is 30. + ${Timeout}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Validate that the WebTest returns the http status code provided. + ${ValidationRuleExpectedHttpStatusCode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When set, validation will ignore the status code. + ${ValidationRuleIgnoreHttpsStatusCode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # A number of days to check still remain before the the existing SSL cert expires. + # Value must be positive and the SSLCheck must be set to true. + ${ValidationRuleSslCertRemainingLifetimeCheck}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Checks to see if the SSL cert is still valid. + ${ValidationRuleSslCheck}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum] + # The kind of web test this is, valid choices are ping, multistep, and standard. + ${WebTestKind}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsWebTest_UpdateExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Update linked storage accounts for an Application Insights component. +.Description +Update linked storage accounts for an Application Insights component. +.Example +PS C:\> $account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" +PS C:\> Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Update-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightslinkedstorageaccount +#> +function Update-AzApplicationInsightsLinkedStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Linked storage account resource ID + ${LinkedStorageAccountResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Creates or updates an Application Insights web test definition. +.Description +Creates or updates an Application Insights web test definition. +.Example +Update-AzApplicationInsightsWebTestTag -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/lucasappinsights" = "Resource"} +.Example +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -WebTestName webtest01-lucasappinsights | Update-AzApplicationInsightsWebTestTag -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightswebtesttag +#> +function Update-AzApplicationInsightsWebTestTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights WebTest resource. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Returns an Application Insights component. +.Description +Returns an Application Insights component. +.Example +PS C:\> Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" +.Example +PS C:\> Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePricingPlan + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponent +#> +function Get-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent], [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan])] +[CmdletBinding(DefaultParameterSetName='ListBySubscription', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='ListBySubscription')] + [Parameter(ParameterSetName='ListByResourceGroupName')] + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ListByResourceGroupName', Mandatory)] + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='GetByResourceId', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The resource ID of applicationinsights component. + ${ResourceId}, + + [Parameter(ParameterSetName='GetByInputObject', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetByResourceId')] + [Alias('IncludeDailyCap', 'IncludeDailyCapStatus', 'IncludePricingPlan')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + ${Full}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + ListBySubscription = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; + ListByResourceGroupName = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; + Get = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; + GetByResourceId = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; + GetByInputObject = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; + } + if (('ListBySubscription', 'ListByResourceGroupName', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Description +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Example +PS C:\> New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights +#> +function New-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource location + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The kind of application that this component refers to, used to customize UI. + # This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. + ${Kind}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + # Type of application being monitored. + ${ApplicationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable IP masking. + ${DisableIPMasking}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable Non-AAD based Auth. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource etag + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + # Used by the Application Insights system to determine what kind of flow this component was created by. + # This is to be set to 'Bluefield' when creating/updating a component via the REST API. + ${FlowType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Force users to create their own storage account for profiler and debugger. + ${ForceCustomerStorageForProfiler}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + ${HockeyAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Purge data immediately after 30 days. + ${ImmediatePurgeDataOn30Day}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + # Indicates the flow of the ingestion. + ${IngestionMode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights ingestion. + ${PublicNetworkAccessForIngestion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights query. + ${PublicNetworkAccessForQuery}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + # Describes what tool created this Application Insights component. + # Customers using this API should set this to the default 'rest'. + ${RequestSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Retention period in days. + ${RetentionInDays}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + ${SamplingPercentage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource Id of the log analytics workspace which the data will be ingested to. + # This property is required to create an application with this API version. + # Applications from older versions will not have this property. + ${WorkspaceResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + __AllParameterSets = 'Az.ApplicationInsights.custom\New-AzApplicationInsights'; + } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Create an API Key of an Application Insights component. +.Description +Create an API Key of an Application Insights component. +.Example +PS C:\> $apiKeyDescription = "testapiKey" +PS C:\> $permissions = @("ReadTelemetry", "WriteAnnotations") +PS C:\> New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Description $apiKeyDescription -Permissions $permissions + + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsapikey +#> +function New-AzApplicationInsightsApiKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[CmdletBinding(DefaultParameterSetName='ComponentNameParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of the API Key. + ${Description}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # The read access rights of this API Key. + ${Permissions}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + ComponentNameParameterSet = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsApiKey'; + } + if (('ComponentNameParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Create a Continuous Export configuration of an Application Insights component. +.Description +Create a Continuous Export configuration of an Application Insights component. +.Example +PS C:\> $sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +PS C:\> $sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +PS C:\> New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" ` +-DocumentType "Request","Trace", "Custom Event" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus ` +-StorageSASUri $sasuri + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport +#> +function New-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The Continuous Export destination type. + # This has to be 'Blob'. + ${DestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + ${DocumentType }, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of destination storage account. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The location ID of the destination storage container. + ${StorageLocation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The SAS URL for the destination storage container. + # It must grant write permission. + ${StorageSASUri}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + CreateExpanded = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsContinuousExport'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Creates or updates an Application Insights web test definition. +.Description +Creates or updates an Application Insights web test definition. +.Example +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` +-Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` +-RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'standard-pwsh01' ` +-RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation +.Example +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +-Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` +-GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` +-Kind 'ping' -RequestUrl 'https://cn.bing.com' -RequestParseDependent -RuleExpectedHttpStatusCode 200 ` +-ContentMatch "status" +.Example +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +-Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` +-GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` +-Kind 'ping' ` +-Configuration " + + + + + + + + + + + + + +" + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest +.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. + +GEOLOCATION : A list of where to physically run the tests from to give global coverage for accessibility of your application. + [Location ]: Location ID for the WebTest to run from. + +REQUESTHEADER : List of headers and their values to add to the WebTest call. + [Name ]: The name of the header. + [Value ]: The value of the header. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightswebtest +#> +function New-AzApplicationInsightsWebTest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest])] +[CmdletBinding(DefaultParameterSetName='CreateStandard', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('WebTestName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights WebTest resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource location + ${Location}, + + [Parameter(ParameterSetName='CreateStandard')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When set, this value makes the ContentMatch validation case insensitive. + ${ContentIgnoreCase}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Content to look for in the return of the WebTest. + # Must not be null or empty. + ${ContentMatch}, + + [Parameter(ParameterSetName='CreateStandard')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When true, validation will pass if there is a match for the ContentMatch string. + # If false, validation will fail if there is a match + ${ContentPassIfTextFound}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # User defined description for this WebTest. + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Is the test actively being monitored. ${Enabled}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Int32] - # Interval in seconds between test runs for this WebTest. - # Default value is 300. - ${Frequency}, + [System.Int32] + # Interval in seconds between test runs for this WebTest. + # Default value is 300. + ${Frequency}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation[]] + # A list of where to physically run the tests from to give global coverage for accessibility of your application. + # To construct, see NOTES section for GEOLOCATION properties and create a hash table. + ${GeoLocation}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum] + # The kind of web test this is, valid choices are ping, multistep, and standard. + ${Kind}, + + [Parameter(ParameterSetName='CreateStandard')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Base64 encoded string body to send with this web test. + ${RequestBody}, + + [Parameter(ParameterSetName='CreateStandard')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Follow redirects for this web test. + ${RequestFollowRedirect}, + + [Parameter(ParameterSetName='CreateStandard')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField[]] + # List of headers and their values to add to the WebTest call. + # To construct, see NOTES section for REQUESTHEADER properties and create a hash table. + ${RequestHeader}, + + [Parameter(ParameterSetName='CreateStandard')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Http verb to use for this web test. + ${RequestHttpVerb}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Parse Dependent request for this WebTest. + ${RequestParseDependent}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Url location to test. + ${RequestUrl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow for retries should this WebTest fail. + ${RetryEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Validate that the WebTest returns the http status code provided. + ${RuleExpectedHttpStatusCode}, + + [Parameter(ParameterSetName='CreateStandard')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When set, validation will ignore the status code. + ${RuleIgnoreHttpsStatusCode}, + + [Parameter(ParameterSetName='CreateStandard')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # A number of days to check still remain before the the existing SSL cert expires. + # Value must be positive and the SSLCheck must be set to true. + ${RuleSslCertRemainingLifetimeCheck}, + + [Parameter(ParameterSetName='CreateStandard')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Checks to see if the SSL cert is still valid. + ${RuleSslCheck}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # User defined name if this WebTest. + ${TestName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Seconds until this WebTest will timeout and fail. + # Default value is 30. + ${Timeout}, + + [Parameter(ParameterSetName='CreateClassic')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The XML specification of a WebTest to run against an application. + ${Configuration}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + CreateStandard = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTest'; + CreateClassic = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTest'; + } + if (('CreateStandard', 'CreateClassic') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Create an in-memory object for WebTestGeolocation. +.Description +Create an in-memory object for WebTestGeolocation. +.Example +New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestGeolocation +.Link +https://docs.microsoft.com/powershell/module/az.ApplicationInsights/new-AzApplicationInsightsWebTestGeolocationObject +#> +function New-AzApplicationInsightsWebTestGeolocationObject { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestGeolocation])] +[CmdletBinding(PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Location ID for the WebTest to run from. + ${Location} +) + +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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + __AllParameterSets = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTestGeolocationObject'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Create a in-memory object for HeaderField +.Description +Create a in-memory object for HeaderField +.Example +New-AzApplicationInsightsWebTestHeaderFieldObject -Name 'version' -Value '2.0.1' + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.HeaderField +.Link +https://docs.microsoft.com/powershell/module/az.ApplicationInsights/new-AzApplicationInsightsWebTestHeaderFieldObject +#> +function New-AzApplicationInsightsWebTestHeaderFieldObject { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.HeaderField])] +[CmdletBinding(PositionalBinding=$false)] +param( [Parameter()] - [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation[]] - # A list of where to physically run the tests from to give global coverage for accessibility of your application. - # To construct, see NOTES section for GEOLOCATION properties and create a hash table. - ${GeoLocation}, + [System.String] + # The name of the header. + ${Name}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum])] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum] - # The kind of web test this is, valid choices are ping, multistep, and standard. - ${Kind}, + [System.String] + # The value of the header. + ${Value} +) + +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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + __AllParameterSets = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTestHeaderFieldObject'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Create a Continuous Export configuration of an Application Insights component. +.Description +Create a Continuous Export configuration of an Application Insights component. +.Example +PS C:\> $sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +PS C:\> $sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +PS C:\> Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" +-DocumentType "Request","Trace" -ExportId "jlTFEiBg1rkDXOCIeJQ2mB2TxZg=" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus +-StorageSASUri $sasuri + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport +#> +function Set-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The Continuous Export destination type. + # This has to be 'Blob'. + ${DestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueEnabled}, - [Parameter(ParameterSetName='CreateStandard')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] - # Base64 encoded string body to send with this web test. - ${RequestBody}, + # Deprecated + ${NotificationQueueUri}, - [Parameter(ParameterSetName='CreateStandard')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Follow redirects for this web test. - ${RequestFollowRedirect}, + [System.String[]] + ${DocumentType }, - [Parameter(ParameterSetName='CreateStandard')] - [AllowEmptyCollection()] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField[]] - # List of headers and their values to add to the WebTest call. - # To construct, see NOTES section for REQUESTHEADER properties and create a hash table. - ${RequestHeader}, + [System.String] + # The name of destination storage account. + ${StorageAccountId}, - [Parameter(ParameterSetName='CreateStandard')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] - # Http verb to use for this web test. - ${RequestHttpVerb}, + # The location ID of the destination storage container. + ${StorageLocation}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] - # Parse Dependent request for this WebTest. - ${RequestParseDependent}, + ${DisableConfiguration}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] - # Url location to test. - ${RequestUrl}, + # The SAS URL for the destination storage container. + # It must grant write permission. + ${StorageSASUri}, [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] [System.Management.Automation.SwitchParameter] - # Allow for retries should this WebTest fail. - ${RetryEnabled}, + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + CreateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsContinuousExport'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Update current billing features for an Application Insights component. +.Description +Update current billing features for an Application Insights component. +.Example +PS C:\> Set-AzApplicationInsightsDailyCap -ResourceGroupName "testgroup" -Name "test" -DailyCapGB 400 -DisableNotificationWhenHitCap + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightsdailycap +#> +function Set-AzApplicationInsightsDailyCap { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Int32] - # Validate that the WebTest returns the http status code provided. - ${RuleExpectedHttpStatusCode}, + [System.Double] + # Daily data volume cap in GB. + ${DailyCapGB}, - [Parameter(ParameterSetName='CreateStandard')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] - # When set, validation will ignore the status code. - ${RuleIgnoreHttpsStatusCode}, + # Stop send notification when hit cap. + ${DisableNotificationWhenHitCap}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + UpdateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsDailyCap'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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 + } +} +} + +<# +.Synopsis +Update current billing features for an Application Insights component. +.Description +Update current billing features for an Application Insights component. +.Example +PS C:\> Set-AzApplicationInsightsPricingPlan -ResourceGroupName "testgroup" -Name "test" -PricingPlan "Basic" -DailyCapGB 400 - [Parameter(ParameterSetName='CreateStandard')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Int32] - # A number of days to check still remain before the the existing SSL cert expires. - # Value must be positive and the SSLCheck must be set to true. - ${RuleSslCertRemainingLifetimeCheck}, +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightspricingplan +#> +function Set-AzApplicationInsightsPricingPlan { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, - [Parameter(ParameterSetName='CreateStandard')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Checks to see if the SSL cert is still valid. - ${RuleSslCheck}, + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags]))] - [System.Collections.Hashtable] - # Resource tags - ${Tag}, + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, [Parameter()] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] - # User defined name if this WebTest. - ${TestName}, + # Current enabled pricing plan. + # When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + ${PricingPlan}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Int32] - # Seconds until this WebTest will timeout and fail. - # Default value is 30. - ${Timeout}, + [System.Double] + # Daily data volume cap in GB. + ${DailyCapGB}, - [Parameter(ParameterSetName='CreateClassic')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # The XML specification of a WebTest to run against an application. - ${Configuration}, + [System.Management.Automation.SwitchParameter] + # Stop send notification when hit cap. + ${DisableNotificationWhenHitCap}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -854,11 +4688,28 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ - CreateStandard = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTest'; - CreateClassic = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTest'; + UpdateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsPricingPlan'; } - if (('CreateStandard', 'CreateClassic') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -868,6 +4719,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -876,117 +4728,229 @@ 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.ApplicationInsights.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 } -} +} } <# .Synopsis -Create an in-memory object for WebTestGeolocation. +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Description -Create an in-memory object for WebTestGeolocation. +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Example -PS C:\> New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" - -Location --------- -emea-nl-ams-azr +PS C:\> Update-AzApplicationInsights -ResourceGroupName "rgName" -Name "aiName" -PublicNetworkAccessForIngestion "Disabled" -PublicNetworkAccessForQuery "Disabled" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestGeolocation +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent .Link -https://docs.microsoft.com/powershell/module/az.ApplicationInsights/new-AzApplicationInsightsWebTestGeolocationObject +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights #> -function New-AzApplicationInsightsWebTestGeolocationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTestGeolocation])] -[CmdletBinding(PositionalBinding=$false)] +function Update-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] - # Location ID for the WebTest to run from. - ${Location} -) + # The ID of the target subscription. + ${SubscriptionId}, -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - $mapping = @{ - __AllParameterSets = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTestGeolocationObject'; - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - throw - } -} + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + # Type of application being monitored. + ${ApplicationType}, -process { - try { - $steppablePipeline.Process($_) - } catch { - throw - } -} + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable IP masking. + ${DisableIPMasking}, -end { - try { - $steppablePipeline.End() - } catch { - throw - } -} -} + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable Non-AAD based Auth. + ${DisableLocalAuth}, -<# -.Synopsis -Create a in-memory object for HeaderField -.Description -Create a in-memory object for HeaderField -.Example -PS C:\> New-AzApplicationInsightsWebTestHeaderFieldObject -Name 'version' -Value '2.0.1' + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource etag + ${Etag}, -Name Value ----- ----- -version 2.0.1 + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + # Used by the Application Insights system to determine what kind of flow this component was created by. + # This is to be set to 'Bluefield' when creating/updating a component via the REST API. + ${FlowType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Force users to create their own storage account for profiler and debugger. + ${ForceCustomerStorageForProfiler}, -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.HeaderField -.Link -https://docs.microsoft.com/powershell/module/az.ApplicationInsights/new-AzApplicationInsightsWebTestHeaderFieldObject -#> -function New-AzApplicationInsightsWebTestHeaderFieldObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.HeaderField])] -[CmdletBinding(PositionalBinding=$false)] -param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] - # The name of the header. - ${Name}, + # The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + ${HockeyAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Purge data immediately after 30 days. + ${ImmediatePurgeDataOn30Day}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + # Indicates the flow of the ingestion. + ${IngestionMode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights ingestion. + ${PublicNetworkAccessForIngestion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights query. + ${PublicNetworkAccessForQuery}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + # Describes what tool created this Application Insights component. + # Customers using this API should set this to the default 'rest'. + ${RequestSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Retention period in days. + ${RetentionInDays}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + ${SamplingPercentage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] - # The value of the header. - ${Value} + # Resource Id of the log analytics workspace which the data will be ingested to. + # This property is required to create an application with this API version. + # Applications from older versions will not have this property. + ${WorkspaceResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} ) begin { @@ -996,8 +4960,29 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ - __AllParameterSets = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTestHeaderFieldObject'; + __AllParameterSets = 'Az.ApplicationInsights.custom\Update-AzApplicationInsights'; + } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -1006,6 +4991,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -1014,15 +5000,32 @@ 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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsights.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsights.ps1 new file mode 100644 index 000000000000..0ad6581a7bc3 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsights.ps1 @@ -0,0 +1,211 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Deletes an Application Insights component. +.Description +Deletes an Application Insights component. +.Example +PS C:\> Remove-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -PassThru + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +System.Boolean +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsights +#> +function Remove-AzApplicationInsights { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsights_Delete'; + DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsights_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsApiKey.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsApiKey.ps1 new file mode 100644 index 000000000000..f2f5be037afa --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsApiKey.ps1 @@ -0,0 +1,212 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Delete an API Key of an Application Insights component. +.Description +Delete an API Key of an Application Insights component. +.Example +PS C:\> Remove-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId dd173f38-4fd1-4c75-8af5-99c29aa0f867 -PassThru + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightsapikey +#> +function Remove-AzApplicationInsightsApiKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The API Key ID. + # This is unique within a Application Insights component. + ${ApiKeyId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsApiKey_Delete'; + DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsApiKey_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsContinuousExport.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsContinuousExport.ps1 new file mode 100644 index 000000000000..c24505d02a25 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsContinuousExport.ps1 @@ -0,0 +1,212 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Delete a Continuous Export configuration of an Application Insights component. +.Description +Delete a Continuous Export configuration of an Application Insights component. +.Example +PS C:\> Remove-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "uGOoki0jQsyEs3IdQ83Q4QsNr4=" -PassThru + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightscontinuousexport +#> +function Remove-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The Continuous Export configuration ID. + # This is unique within a Application Insights component. + ${ExportId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsContinuousExport_Delete'; + DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsContinuousExport_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsLinkedStorageAccount.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsLinkedStorageAccount.ps1 new file mode 100644 index 000000000000..2bcff55b9fc6 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsLinkedStorageAccount.ps1 @@ -0,0 +1,211 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Delete linked storage accounts for an Application Insights component. +.Description +Delete linked storage accounts for an Application Insights component. +.Example +PS C:\> Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Remove-AzApplicationInsightsLinkedStorageAccount + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +System.Boolean +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightslinkedstorageaccount +#> +function Remove-AzApplicationInsightsLinkedStorageAccount { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsLinkedStorageAccount_Delete'; + DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWebTest.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWebTest.ps1 index e275f6a3fea8..9929ccc0b493 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWebTest.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWebTest.ps1 @@ -20,11 +20,9 @@ Deletes an Application Insights web test. .Description Deletes an Application Insights web test. .Example -PS C:\> Remove-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtest01-lucasappinsights - +Remove-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standardwebtest01-lucasappinsights .Example -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights | Remove-AzApplicationInsightsWebTest - +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights | Remove-AzApplicationInsightsWebTest .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity @@ -36,9 +34,15 @@ 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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. [SubscriptionId ]: The ID of the target subscription. [WebTestName ]: The name of the Application Insights WebTest resource. .Link @@ -137,6 +141,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWebTest_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWebTest_DeleteViaIdentity'; @@ -151,6 +173,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -159,15 +182,32 @@ 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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsContinuousExport.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsContinuousExport.ps1 new file mode 100644 index 000000000000..c2ca2946d48c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsContinuousExport.ps1 @@ -0,0 +1,201 @@ + +# ---------------------------------------------------------------------------------- +# 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 a Continuous Export configuration of an Application Insights component. +.Description +Create a Continuous Export configuration of an Application Insights component. +.Example +PS C:\> $sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +PS C:\> $sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +PS C:\> Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" +-DocumentType "Request","Trace" -ExportId "jlTFEiBg1rkDXOCIeJQ2mB2TxZg=" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus +-StorageSASUri $sasuri + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport +#> +function Set-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The Continuous Export configuration ID. + # This is unique within a Application Insights component. + ${ExportId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The Continuous Export destination type. + # This has to be 'Blob'. + ${DestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + ${DocumentType }, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of destination storage account. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The location ID of the destination storage container. + ${StorageLocation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + ${DisableConfiguration}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The SAS URL for the destination storage container. + # It must grant write permission. + ${StorageSASUri}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + $mapping = @{ + CreateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsContinuousExport'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + throw + } +} + +end { + try { + $steppablePipeline.End() + } catch { + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsDailyCap.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsDailyCap.ps1 new file mode 100644 index 000000000000..dd771fd351a8 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsDailyCap.ps1 @@ -0,0 +1,190 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Update current billing features for an Application Insights component. +.Description +Update current billing features for an Application Insights component. +.Example +PS C:\> Set-AzApplicationInsightsDailyCap -ResourceGroupName "testgroup" -Name "test" -DailyCapGB 400 -DisableNotificationWhenHitCap + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightsdailycap +#> +function Set-AzApplicationInsightsDailyCap { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Daily data volume cap in GB. + ${DailyCapGB}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Stop send notification when hit cap. + ${DisableNotificationWhenHitCap}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + UpdateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsDailyCap'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsPricingPlan.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsPricingPlan.ps1 new file mode 100644 index 000000000000..45ce41fe2328 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsPricingPlan.ps1 @@ -0,0 +1,198 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Update current billing features for an Application Insights component. +.Description +Update current billing features for an Application Insights component. +.Example +PS C:\> Set-AzApplicationInsightsPricingPlan -ResourceGroupName "testgroup" -Name "test" -PricingPlan "Basic" -DailyCapGB 400 + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightspricingplan +#> +function Set-AzApplicationInsightsPricingPlan { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Current enabled pricing plan. + # When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + ${PricingPlan}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Daily data volume cap in GB. + ${DailyCapGB}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Stop send notification when hit cap. + ${DisableNotificationWhenHitCap}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + UpdateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsPricingPlan'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsWebTest.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsWebTest.ps1 new file mode 100644 index 000000000000..ca67af78bc79 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsWebTest.ps1 @@ -0,0 +1,365 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Creates or updates an Application Insights web test definition. +.Description +Creates or updates an Application Insights web test definition. +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest +.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. + +PROPERTIESLOCATIONS : A list of where to physically run the tests from to give global coverage for accessibility of your application. + [Location ]: Location ID for the WebTest to run from. + +REQUESTHEADER : List of headers and their values to add to the WebTest call. + [Name ]: The name of the header. + [Value ]: The value of the header. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightswebtest +#> +function Set-AzApplicationInsightsWebTest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('WebTestName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights WebTest resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource location + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The XML specification of a WebTest to run against an application. + ${ConfigurationWebTest}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Content to look for in the return of the WebTest. + # Must not be null or empty. + ${ContentValidationContentMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When set, this value makes the ContentMatch validation case insensitive. + ${ContentValidationIgnoreCase}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When true, validation will pass if there is a match for the ContentMatch string. + # If false, validation will fail if there is a match + ${ContentValidationPassIfTextFound}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # User defined description for this WebTest. + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Is the test actively being monitored. + ${Enabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Interval in seconds between test runs for this WebTest. + # Default value is 300. + ${Frequency}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind] + # The kind of WebTest that this web test watches. + # Choices are ping and multistep. + ${Kind}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation[]] + # A list of where to physically run the tests from to give global coverage for accessibility of your application. + # To construct, see NOTES section for PROPERTIESLOCATIONS properties and create a hash table. + ${PropertiesLocations}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # User defined name if this WebTest. + ${PropertiesWebTestName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Base64 encoded string body to send with this web test. + ${RequestBody}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Follow redirects for this web test. + ${RequestFollowRedirect}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField[]] + # List of headers and their values to add to the WebTest call. + # To construct, see NOTES section for REQUESTHEADER properties and create a hash table. + ${RequestHeader}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Http verb to use for this web test. + ${RequestHttpVerb}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Parse Dependent request for this WebTest. + ${RequestParseDependentRequest}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Url location to test. + ${RequestUrl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow for retries should this WebTest fail. + ${RetryEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Unique ID of this WebTest. + # This is typically the same value as the Name field. + ${SyntheticMonitorId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Seconds until this WebTest will timeout and fail. + # Default value is 30. + ${Timeout}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Validate that the WebTest returns the http status code provided. + ${ValidationRuleExpectedHttpStatusCode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When set, validation will ignore the status code. + ${ValidationRuleIgnoreHttpsStatusCode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # A number of days to check still remain before the the existing SSL cert expires. + # Value must be positive and the SSLCheck must be set to true. + ${ValidationRuleSslCertRemainingLifetimeCheck}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Checks to see if the SSL cert is still valid. + ${ValidationRuleSslCheck}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum] + # The kind of web test this is, valid choices are ping, multistep, and standard. + ${WebTestKind}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsWebTest_UpdateExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsights.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsights.ps1 new file mode 100644 index 000000000000..791280a3b364 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsights.ps1 @@ -0,0 +1,252 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Description +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Example +PS C:\> Update-AzApplicationInsights -ResourceGroupName "rgName" -Name "aiName" -PublicNetworkAccessForIngestion "Disabled" -PublicNetworkAccessForQuery "Disabled" + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights +#> +function Update-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + # Type of application being monitored. + ${ApplicationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable IP masking. + ${DisableIPMasking}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable Non-AAD based Auth. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource etag + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + # Used by the Application Insights system to determine what kind of flow this component was created by. + # This is to be set to 'Bluefield' when creating/updating a component via the REST API. + ${FlowType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Force users to create their own storage account for profiler and debugger. + ${ForceCustomerStorageForProfiler}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + ${HockeyAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Purge data immediately after 30 days. + ${ImmediatePurgeDataOn30Day}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + # Indicates the flow of the ingestion. + ${IngestionMode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights ingestion. + ${PublicNetworkAccessForIngestion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights query. + ${PublicNetworkAccessForQuery}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + # Describes what tool created this Application Insights component. + # Customers using this API should set this to the default 'rest'. + ${RequestSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Retention period in days. + ${RetentionInDays}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + ${SamplingPercentage}, + + [Parameter()] + [Alias('Tags')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource Id of the log analytics workspace which the data will be ingested to. + # This property is required to create an application with this API version. + # Applications from older versions will not have this property. + ${WorkspaceResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + $mapping = @{ + __AllParameterSets = 'Az.ApplicationInsights.custom\Update-AzApplicationInsights'; + } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + throw + } +} + +end { + try { + $steppablePipeline.End() + } catch { + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsLinkedStorageAccount.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsLinkedStorageAccount.ps1 new file mode 100644 index 000000000000..9a2dc55c6cb4 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsLinkedStorageAccount.ps1 @@ -0,0 +1,212 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Update linked storage accounts for an Application Insights component. +.Description +Update linked storage accounts for an Application Insights component. +.Example +PS C:\> $account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" +PS C:\> Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Update-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightslinkedstorageaccount +#> +function Update-AzApplicationInsightsLinkedStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Linked storage account resource ID + ${LinkedStorageAccountResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ + UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWebTestTag.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWebTestTag.ps1 index 62b8f724b93d..f7665cfa8a32 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWebTestTag.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWebTestTag.ps1 @@ -20,17 +20,9 @@ Creates or updates an Application Insights web test definition. .Description Creates or updates an Application Insights web test definition. .Example -PS C:\> Update-AzApplicationInsightsWebTestTag -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/lucasappinsights" = "Resource"} - -Location Name WebTestKind ResourceGroupName Enabled --------- ---- ----------- ----------------- ------- -westus2 webtest01-lucasappinsights standard azpwsh-rg-test True +Update-AzApplicationInsightsWebTestTag -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/lucasappinsights" = "Resource"} .Example -PS C:\> Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -WebTestName webtest01-lucasappinsights | Update-AzApplicationInsightsWebTestTag -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} - -Location Name WebTestKind ResourceGroupName Enabled --------- ---- ----------- ----------------- ------- -westus2 webtest01-lucasappinsights standard azpwsh-rg-test True +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -WebTestName webtest01-lucasappinsights | Update-AzApplicationInsightsWebTestTag -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity @@ -42,9 +34,15 @@ 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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. [SubscriptionId ]: The ID of the target subscription. [WebTestName ]: The name of the Application Insights WebTest resource. .Link @@ -143,6 +141,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 = @{ UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded'; @@ -157,6 +173,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -165,15 +182,32 @@ 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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/generate-info.json b/src/ApplicationInsights/ApplicationInsights.Autorest/generate-info.json new file mode 100644 index 000000000000..745b5552b24b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generate-info.json @@ -0,0 +1,8 @@ +{ + "autorest": "`-- (empty)", + "autorest_core": "3.8.4", + "node": "v14.15.5", + "autorest_modelerfour": "4.15.414", + "autorest_powershell": "3.0.485", + "swagger_commit": "11830d3ce01db4f39a41dc37a86075b125c87fdc" +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/Module.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/Module.cs index 6180cfc6bc10..2edc3af41d2e 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/Module.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/Module.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights 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>; @@ -30,6 +32,8 @@ public partial class Module /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline _pipelineWithProxy; + public bool _useProxy = false; + public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); /// Gets completion data for azure specific fields @@ -44,6 +48,9 @@ public partial class Module /// 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; } + /// Backing field for property. private static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module _instance; @@ -65,6 +72,9 @@ public partial class Module /// The ResourceID for this module (azure arm). public string ResourceId => @"Az.ApplicationInsights"; + /// The delegate for creating a telemetry. + public TelemetryDelegate Telemetry { get; set; } + /// The from the cmdlet /// The HttpPipeline for the request @@ -88,7 +98,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeli { Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline pipeline = null; BeforeCreatePipeline(invocationInfo, ref pipeline); - pipeline = (pipeline ?? (_handler.UseProxy ? _pipelineWithProxy : _pipeline)).Clone(); + 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); } ); @@ -127,12 +137,24 @@ private Module() /// 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; - _webProxy.Credentials = proxyCredential ?.GetNetworkCredential(); - _webProxy.UseDefaultCredentials = proxyUseDefaultCredentials; - _handler.UseProxy = proxy != null; + 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 diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/ApplicationInsightsManagementClient.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/ApplicationInsightsManagementClient.cs index 0afb0314811d..9ba349fe5d5c 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/ApplicationInsightsManagementClient.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/ApplicationInsightsManagementClient.cs @@ -14,6 +14,5279 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights public partial class ApplicationInsightsManagementClient { + /// Create an Annotation of an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to create an annotation of a Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AnnotationsCreate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/Annotations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AnnotationsCreate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create an Annotation of an Application Insights component. + /// + /// Properties that need to be specified to create an annotation of a Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AnnotationsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/Annotations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/Annotations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AnnotationsCreate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AnnotationsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __y) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.Annotation.FromJson(__x) )) ))() : null)); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.AnnotationError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to create an annotation of a Application Insights component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AnnotationsCreate_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete an Annotation of an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The unique annotation ID. This is unique within a Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AnnotationsDelete(string resourceGroupName, string subscriptionId, string resourceName, string annotationId, global::System.Func onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/Annotations/" + + global::System.Uri.EscapeDataString(annotationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AnnotationsDelete_Call(request,onOk,eventListener,sender); + } + } + + /// Delete an Annotation of an Application Insights component. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AnnotationsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/Annotations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var annotationId = _match.Groups["annotationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/Annotations/" + + annotationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AnnotationsDelete_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AnnotationsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The unique annotation ID. This is unique within a Application Insights component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AnnotationsDelete_Validate(string resourceGroupName, string subscriptionId, string resourceName, string annotationId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(annotationId),annotationId); + } + } + + /// Get the annotation for given id. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The unique annotation ID. This is unique within a Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AnnotationsGet(string resourceGroupName, string subscriptionId, string resourceName, string annotationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/Annotations/" + + global::System.Uri.EscapeDataString(annotationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AnnotationsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the annotation for given id. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AnnotationsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/Annotations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var annotationId = _match.Groups["annotationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/Annotations/" + + annotationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AnnotationsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AnnotationsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __y) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.Annotation.FromJson(__x) )) ))() : null)); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.AnnotationError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The unique annotation ID. This is unique within a Application Insights component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AnnotationsGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, string annotationId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(annotationId),annotationId); + } + } + + /// Gets the list of annotations for a component for given time range + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The start time to query from for annotations, cannot be older than 90 days from current date. + /// The end time to query for annotations. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AnnotationsList(string resourceGroupName, string subscriptionId, string resourceName, string start, string end, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/Annotations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "start=" + global::System.Uri.EscapeDataString(start) + + "&" + + "end=" + global::System.Uri.EscapeDataString(end) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AnnotationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the list of annotations for a component for given time range + /// + /// The start time to query from for annotations, cannot be older than 90 days from current date. + /// The end time to query for annotations. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AnnotationsListViaIdentity(global::System.String viaIdentity, string start, string end, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/Annotations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/Annotations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "start=" + global::System.Uri.EscapeDataString(start) + + "&" + + "end=" + global::System.Uri.EscapeDataString(end) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AnnotationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AnnotationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.AnnotationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.AnnotationError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The start time to query from for annotations, cannot be older than 90 days from current date. + /// The end time to query for annotations. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AnnotationsList_Validate(string resourceGroupName, string subscriptionId, string resourceName, string start, string end, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(start),start); + await eventListener.AssertNotNull(nameof(end),end); + } + } + + /// Create an API Key of an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to create an API key of a Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiKeysCreate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/ApiKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiKeysCreate_Call(request,onOk,eventListener,sender); + } + } + + /// Create an API Key of an Application Insights component. + /// + /// Properties that need to be specified to create an API key of a Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiKeysCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/ApiKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiKeysCreate_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiKeysCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentApiKey.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to create an API key of a Application Insights component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiKeysCreate_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete an API Key of an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The API Key ID. This is unique within a Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiKeysDelete(string resourceGroupName, string subscriptionId, string resourceName, string keyId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/APIKeys/" + + global::System.Uri.EscapeDataString(keyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiKeysDelete_Call(request,onOk,eventListener,sender); + } + } + + /// Delete an API Key of an Application Insights component. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiKeysDeleteViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/APIKeys/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var keyId = _match.Groups["keyId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/APIKeys/" + + keyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiKeysDelete_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiKeysDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentApiKey.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The API Key ID. This is unique within a Application Insights component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiKeysDelete_Validate(string resourceGroupName, string subscriptionId, string resourceName, string keyId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(keyId),keyId); + } + } + + /// Get the API Key for this key id. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The API Key ID. This is unique within a Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiKeysGet(string resourceGroupName, string subscriptionId, string resourceName, string keyId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/APIKeys/" + + global::System.Uri.EscapeDataString(keyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiKeysGet_Call(request,onOk,eventListener,sender); + } + } + + /// Get the API Key for this key id. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiKeysGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/APIKeys/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var keyId = _match.Groups["keyId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/APIKeys/" + + keyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiKeysGet_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiKeysGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentApiKey.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The API Key ID. This is unique within a Application Insights component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiKeysGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, string keyId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(keyId),keyId); + } + } + + /// Gets a list of API keys of an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiKeysList(string resourceGroupName, string subscriptionId, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/ApiKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiKeysList_Call(request,onOk,eventListener,sender); + } + } + + /// Gets a list of API keys of an Application Insights component. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiKeysListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/ApiKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/ApiKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiKeysList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiKeysList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentApiKeyListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiKeysList_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// Returns all available features of the application insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentAvailableFeaturesGet(string resourceGroupName, string subscriptionId, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/getavailablebillingfeatures" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentAvailableFeaturesGet_Call(request,onOk,eventListener,sender); + } + } + + /// Returns all available features of the application insights component. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentAvailableFeaturesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/getavailablebillingfeatures$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/getavailablebillingfeatures'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/getavailablebillingfeatures" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentAvailableFeaturesGet_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentAvailableFeaturesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentAvailableFeatures.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentAvailableFeaturesGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// Returns current billing features for an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesGet(string resourceGroupName, string subscriptionId, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/currentbillingfeatures" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentCurrentBillingFeaturesGet_Call(request,onOk,eventListener,sender); + } + } + + /// Returns current billing features for an Application Insights component. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/currentbillingfeatures$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/currentbillingfeatures" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentCurrentBillingFeaturesGet_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentBillingFeatures.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// Update current billing features for an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to update billing features for an Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesUpdate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/currentbillingfeatures" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentCurrentBillingFeaturesUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// Update current billing features for an Application Insights component. + /// + /// Properties that need to be specified to update billing features for an Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/currentbillingfeatures$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/currentbillingfeatures" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentCurrentBillingFeaturesUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentBillingFeatures.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to update billing features for an Application Insights component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesUpdate_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Returns feature capabilities of the application insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentFeatureCapabilitiesGet(string resourceGroupName, string subscriptionId, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/featurecapabilities" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentFeatureCapabilitiesGet_Call(request,onOk,eventListener,sender); + } + } + + /// Returns feature capabilities of the application insights component. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentFeatureCapabilitiesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/featurecapabilities$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/featurecapabilities'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/featurecapabilities" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentFeatureCapabilitiesGet_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentFeatureCapabilitiesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapabilities.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentFeatureCapabilitiesGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// Replace current linked storage account for an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to update linked storage accounts for an Application Insights + /// component. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsCreateAndUpdate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01-preview"; + var storageType = @"ServiceProfiler"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/linkedStorageAccounts/" + + global::System.Uri.EscapeDataString(storageType) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentLinkedStorageAccountsCreateAndUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Replace current linked storage account for an Application Insights component. + /// + /// Properties that need to be specified to update linked storage accounts for an Application Insights + /// component. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsCreateAndUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/linkedStorageAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var storageType = _match.Groups["storageType"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/linkedStorageAccounts/" + + storageType + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentLinkedStorageAccountsCreateAndUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsCreateAndUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ComponentLinkedStorageAccounts.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to update linked storage accounts for an Application Insights + /// component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsCreateAndUpdate_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete linked storage accounts for an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsDelete(string resourceGroupName, string subscriptionId, string resourceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01-preview"; + var storageType = @"ServiceProfiler"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/linkedStorageAccounts/" + + global::System.Uri.EscapeDataString(storageType) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentLinkedStorageAccountsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete linked storage accounts for an Application Insights component. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/linkedStorageAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var storageType = _match.Groups["storageType"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/linkedStorageAccounts/" + + storageType + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentLinkedStorageAccountsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsDelete_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// + /// Returns the current linked storage settings for an Application Insights component. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsGet(string resourceGroupName, string subscriptionId, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01-preview"; + var storageType = @"ServiceProfiler"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/linkedStorageAccounts/" + + global::System.Uri.EscapeDataString(storageType) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentLinkedStorageAccountsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Returns the current linked storage settings for an Application Insights component. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/linkedStorageAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var storageType = _match.Groups["storageType"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/linkedStorageAccounts/" + + storageType + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentLinkedStorageAccountsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ComponentLinkedStorageAccounts.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// Update linked storage accounts for an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to update a linked storage accounts for an Application Insights + /// component. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsUpdate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01-preview"; + var storageType = @"ServiceProfiler"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/linkedStorageAccounts/" + + global::System.Uri.EscapeDataString(storageType) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentLinkedStorageAccountsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Update linked storage accounts for an Application Insights component. + /// + /// Properties that need to be specified to update a linked storage accounts for an Application Insights + /// component. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/linkedStorageAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var storageType = _match.Groups["storageType"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/linkedStorageAccounts/" + + storageType + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentLinkedStorageAccountsUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ComponentLinkedStorageAccounts.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to update a linked storage accounts for an Application Insights + /// component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsUpdate_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Returns daily data volume cap (quota) status for an Application Insights component. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentQuotaStatusGet(string resourceGroupName, string subscriptionId, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/quotastatus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentQuotaStatusGet_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Returns daily data volume cap (quota) status for an Application Insights component. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentQuotaStatusGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/quotastatus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/quotastatus'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/quotastatus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentQuotaStatusGet_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentQuotaStatusGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentQuotaStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentQuotaStatusGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// + /// Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// nor AppId in the Put operation. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to create an Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsCreateOrUpdate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// nor AppId in the Put operation. + /// + /// + /// Properties that need to be specified to create an Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to create an Application Insights component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsCreateOrUpdate_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsDelete(string resourceGroupName, string subscriptionId, string resourceName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes an Application Insights component. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsDelete_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// Returns an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsGet(string resourceGroupName, string subscriptionId, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get status for an ongoing purge operation. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// In a purge status request, this is the Id of the operation the status of which is returned. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsGetPurgeStatus(string resourceGroupName, string subscriptionId, string resourceName, string purgeId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/operations/" + + global::System.Uri.EscapeDataString(purgeId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsGetPurgeStatus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get status for an ongoing purge 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.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsGetPurgeStatusViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/operations/{purgeId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var purgeId = _match.Groups["purgeId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/operations/" + + purgeId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsGetPurgeStatus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsGetPurgeStatus_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeStatusResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// In a purge status request, this is the Id of the operation the status of which is returned. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsGetPurgeStatus_Validate(string resourceGroupName, string subscriptionId, string resourceName, string purgeId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(purgeId),purgeId); + } + } + + /// Returns an Application Insights component. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// Gets a list of all Application Insights components within a subscription. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/microsoft.insights/components" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of Application Insights components within a resource group. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsListByResourceGroup(string resourceGroupName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of Application Insights components within a resource group. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsListByResourceGroup_Validate(string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Gets a list of all Application Insights components within a subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/microsoft.insights/components$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/microsoft.insights/components'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/microsoft.insights/components" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Purges data in an Application Insights component by a set of user-defined filters. + /// In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution + /// of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the + /// in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that + /// the results are expected. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Describes the body of a request to purge data in a single table of an Application Insights component + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsPurge(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody body, global::System.Func, global::System.Threading.Tasks.Task> onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/purge" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsPurge_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// Purges data in an Application Insights component by a set of user-defined filters. + /// In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution + /// of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the + /// in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that + /// the results are expected. + /// + /// + /// Describes the body of a request to purge data in a single table of an Application Insights component + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsPurgeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody body, global::System.Func, global::System.Threading.Tasks.Task> onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/purge" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsPurge_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsPurge_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Describes the body of a request to purge data in a single table of an Application Insights component + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsPurge_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Updated tag information to set into the component instance. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsUpdateTags(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsUpdateTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + /// + /// + /// Updated tag information to set into the component instance. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsUpdateTagsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-02-02"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsUpdateTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsUpdateTags_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Updated tag information to set into the component instance. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ComponentsUpdateTags_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create a Continuous Export configuration of an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to create a Continuous Export configuration of a Application Insights + /// component. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsCreate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/exportconfiguration" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportConfigurationsCreate_Call(request,onOk,eventListener,sender); + } + } + + /// Create a Continuous Export configuration of an Application Insights component. + /// + /// Properties that need to be specified to create a Continuous Export configuration of a Application Insights + /// component. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/exportconfiguration" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportConfigurationsCreate_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportConfigurationsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __y) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportConfiguration.FromJson(__x) )) ))() : null)); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to create a Continuous Export configuration of a Application Insights + /// component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportConfigurationsCreate_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete a Continuous Export configuration of an Application Insights component. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsDelete(string resourceGroupName, string subscriptionId, string resourceName, string exportId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/exportconfiguration/" + + global::System.Uri.EscapeDataString(exportId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportConfigurationsDelete_Call(request,onOk,eventListener,sender); + } + } + + /// Delete a Continuous Export configuration of an Application Insights component. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/exportconfiguration/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var exportId = _match.Groups["exportId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/exportconfiguration/" + + exportId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportConfigurationsDelete_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportConfigurationsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportConfigurationsDelete_Validate(string resourceGroupName, string subscriptionId, string resourceName, string exportId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(exportId),exportId); + } + } + + /// Get the Continuous Export configuration for this export id. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsGet(string resourceGroupName, string subscriptionId, string resourceName, string exportId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/exportconfiguration/" + + global::System.Uri.EscapeDataString(exportId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportConfigurationsGet_Call(request,onOk,eventListener,sender); + } + } + + /// Get the Continuous Export configuration for this export id. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/exportconfiguration/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var exportId = _match.Groups["exportId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/exportconfiguration/" + + exportId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportConfigurationsGet_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportConfigurationsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportConfigurationsGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, string exportId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(exportId),exportId); + } + } + + /// + /// Gets a list of Continuous Export configuration of an Application Insights component. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsList(string resourceGroupName, string subscriptionId, string resourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/exportconfiguration" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportConfigurationsList_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Gets a list of Continuous Export configuration of an Application Insights component. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/exportconfiguration$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/exportconfiguration" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportConfigurationsList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportConfigurationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __y) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportConfiguration.FromJson(__x) )) ))() : null)); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportConfigurationsList_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// Update the Continuous Export configuration for this export id. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// Properties that need to be specified to update the Continuous Export configuration. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsUpdate(string resourceGroupName, string subscriptionId, string resourceName, string exportId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + + "/exportconfiguration/" + + global::System.Uri.EscapeDataString(exportId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportConfigurationsUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// Update the Continuous Export configuration for this export id. + /// + /// Properties that need to be specified to update the Continuous Export configuration. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/components/(?[^/]+)/exportconfiguration/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var exportId = _match.Groups["exportId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/exportconfiguration/" + + exportId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportConfigurationsUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportConfigurationsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. + /// The name of the Application Insights component resource. + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// Properties that need to be specified to update the Continuous Export configuration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ExportConfigurationsUpdate_Validate(string resourceGroupName, string subscriptionId, string resourceName, string exportId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(exportId),exportId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + /// /// List the available operations supported by the Microsoft.EventGrid resource provider. /// @@ -51,6 +5324,151 @@ public partial class ApplicationInsightsManagementClient } } + /// Lists all of the available insights REST API operations. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsList1(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/microsoft.insights/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList1_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all of the available insights REST API operations. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsList1ViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/microsoft.insights/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/microsoft.insights/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/microsoft.insights/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList1_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList1_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList1_Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + /// /// List the available operations supported by the Microsoft.EventGrid resource provider. /// diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.PowerShell.cs index 373914345beb..8ac67d00987c 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.PowerShell.cs @@ -124,7 +124,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.TypeConverter.cs index ca657995dc60..69ef9f7e6c97 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.TypeConverter.cs @@ -26,8 +26,7 @@ public partial class AnyTypeConverter : global::System.Management.Automation.PST public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.PowerShell.cs new file mode 100644 index 000000000000..e0024100c8fa --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + /// + [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] + public partial class ProxyResource + { + + /// + /// 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.ApplicationInsights.Models.Api10.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProxyResource(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.ApplicationInsights.Models.Api10.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProxyResource(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.ApplicationInsights.Models.Api10.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProxyResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, 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 ProxyResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, 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.ApplicationInsights.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 model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] + public partial interface IProxyResource + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.TypeConverter.cs new file mode 100644 index 000000000000..bc1262b58722 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.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.ApplicationInsights.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProxyResourceTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api10.IProxyResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProxyResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProxyResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProxyResource.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.cs new file mode 100644 index 000000000000..27c620b1cb3e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.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.ApplicationInsights.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + /// + public partial class ProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ProxyResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + public partial interface IProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource + { + + } + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + internal partial interface IProxyResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.json.cs new file mode 100644 index 000000000000..183c7088ba00 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.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.ApplicationInsights.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + /// + public partial class ProxyResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs new file mode 100644 index 000000000000..61424cfb264d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial class Resource + { + + /// + /// 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.ApplicationInsights.Models.Api10.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Resource(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.ApplicationInsights.Models.Api10.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Resource(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.ApplicationInsights.Models.Api10.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Resource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, 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 Resource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, 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.ApplicationInsights.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 fields that are returned in the response for all Azure Resource Manager resources + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial interface IResource + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs new file mode 100644 index 000000000000..8a5902e14171 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.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.ApplicationInsights.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api10.IResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Resource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Resource.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.cs new file mode 100644 index 000000000000..b95c6322d33c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal + { + + /// Backing field for property. + private string _id; + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public Resource() + { + + } + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + public partial interface IResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the resource", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + internal partial interface IResourceInternal + + { + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + string Id { get; set; } + /// The name of the resource + string Name { get; set; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.json.cs new file mode 100644 index 000000000000..51245c4bba2c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + public partial class Resource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new Resource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.PowerShell.cs new file mode 100644 index 000000000000..70d3c756fb10 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.PowerShell.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Annotation associated with an application insights resource. + [System.ComponentModel.TypeConverter(typeof(AnnotationTypeConverter))] + public partial class Annotation + { + + /// + /// 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 Annotation(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.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("EventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).EventTime = (global::System.DateTime?) content.GetValueForProperty("EventTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).EventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Property = (string) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Property, global::System.Convert.ToString); + } + if (content.Contains("RelatedAnnotation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).RelatedAnnotation = (string) content.GetValueForProperty("RelatedAnnotation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).RelatedAnnotation, 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 Annotation(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.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("EventTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).EventTime = (global::System.DateTime?) content.GetValueForProperty("EventTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).EventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Property = (string) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Property, global::System.Convert.ToString); + } + if (content.Contains("RelatedAnnotation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).RelatedAnnotation = (string) content.GetValueForProperty("RelatedAnnotation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).RelatedAnnotation, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api20150501.IAnnotation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Annotation(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.ApplicationInsights.Models.Api20150501.IAnnotation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Annotation(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.ApplicationInsights.Models.Api20150501.IAnnotation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Annotation associated with an application insights resource. + [System.ComponentModel.TypeConverter(typeof(AnnotationTypeConverter))] + public partial interface IAnnotation + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.TypeConverter.cs new file mode 100644 index 000000000000..09030dc69d6c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AnnotationTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IAnnotation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Annotation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Annotation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Annotation.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.cs new file mode 100644 index 000000000000..7a4341232756 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Annotation associated with an application insights resource. + public partial class Annotation : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal + { + + /// Backing field for property. + private string _category; + + /// Category of annotation, free form + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Category { get => this._category; set => this._category = value; } + + /// Backing field for property. + private global::System.DateTime? _eventTime; + + /// Time when event occurred + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public global::System.DateTime? EventTime { get => this._eventTime; set => this._eventTime = value; } + + /// Backing field for property. + private string _id; + + /// Unique Id for annotation + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _name; + + /// Name of annotation + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _property; + + /// Serialized JSON object for detailed properties + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Property { get => this._property; set => this._property = value; } + + /// Backing field for property. + private string _relatedAnnotation; + + /// Related parent annotation if any + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string RelatedAnnotation { get => this._relatedAnnotation; set => this._relatedAnnotation = value; } + + /// Creates an new instance. + public Annotation() + { + + } + } + /// Annotation associated with an application insights resource. + public partial interface IAnnotation : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Category of annotation, free form + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Category of annotation, free form", + SerializedName = @"Category", + PossibleTypes = new [] { typeof(string) })] + string Category { get; set; } + /// Time when event occurred + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time when event occurred", + SerializedName = @"EventTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EventTime { get; set; } + /// Unique Id for annotation + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique Id for annotation", + SerializedName = @"Id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Name of annotation + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of annotation", + SerializedName = @"AnnotationName", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Serialized JSON object for detailed properties + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Serialized JSON object for detailed properties", + SerializedName = @"Properties", + PossibleTypes = new [] { typeof(string) })] + string Property { get; set; } + /// Related parent annotation if any + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Related parent annotation if any", + SerializedName = @"RelatedAnnotation", + PossibleTypes = new [] { typeof(string) })] + string RelatedAnnotation { get; set; } + + } + /// Annotation associated with an application insights resource. + internal partial interface IAnnotationInternal + + { + /// Category of annotation, free form + string Category { get; set; } + /// Time when event occurred + global::System.DateTime? EventTime { get; set; } + /// Unique Id for annotation + string Id { get; set; } + /// Name of annotation + string Name { get; set; } + /// Serialized JSON object for detailed properties + string Property { get; set; } + /// Related parent annotation if any + string RelatedAnnotation { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.json.cs new file mode 100644 index 000000000000..e8e0a53f6295 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.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.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Annotation associated with an application insights resource. + public partial class Annotation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal Annotation(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("AnnotationName"), out var __jsonAnnotationName) ? (string)__jsonAnnotationName : (string)Name;} + {_category = If( json?.PropertyT("Category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} + {_eventTime = If( json?.PropertyT("EventTime"), out var __jsonEventTime) ? global::System.DateTime.TryParse((string)__jsonEventTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEventTimeValue) ? __jsonEventTimeValue : EventTime : EventTime;} + {_id = If( json?.PropertyT("Id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_property = If( json?.PropertyT("Properties"), out var __jsonProperties) ? (string)__jsonProperties : (string)Property;} + {_relatedAnnotation = If( json?.PropertyT("RelatedAnnotation"), out var __jsonRelatedAnnotation) ? (string)__jsonRelatedAnnotation : (string)RelatedAnnotation;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new Annotation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._name.ToString()) : null, "AnnotationName" ,container.Add ); + AddIf( null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._category.ToString()) : null, "Category" ,container.Add ); + AddIf( null != this._eventTime ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._eventTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "EventTime" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._id.ToString()) : null, "Id" ,container.Add ); + AddIf( null != (((object)this._property)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._property.ToString()) : null, "Properties" ,container.Add ); + AddIf( null != (((object)this._relatedAnnotation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._relatedAnnotation.ToString()) : null, "RelatedAnnotation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.PowerShell.cs new file mode 100644 index 000000000000..83c784523639 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Error associated with trying to create annotation with Id that already exist + [System.ComponentModel.TypeConverter(typeof(AnnotationErrorTypeConverter))] + public partial class AnnotationError + { + + /// + /// 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 AnnotationError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Innererror")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.InnerErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("InnererrorDiagnosticcontext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorDiagnosticcontext = (string) content.GetValueForProperty("InnererrorDiagnosticcontext",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorDiagnosticcontext, global::System.Convert.ToString); + } + if (content.Contains("InnererrorTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorTime = (global::System.DateTime?) content.GetValueForProperty("InnererrorTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AnnotationError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Innererror")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.InnerErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("InnererrorDiagnosticcontext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorDiagnosticcontext = (string) content.GetValueForProperty("InnererrorDiagnosticcontext",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorDiagnosticcontext, global::System.Convert.ToString); + } + if (content.Contains("InnererrorTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorTime = (global::System.DateTime?) content.GetValueForProperty("InnererrorTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + 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.ApplicationInsights.Models.Api20150501.IAnnotationError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AnnotationError(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.ApplicationInsights.Models.Api20150501.IAnnotationError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AnnotationError(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.ApplicationInsights.Models.Api20150501.IAnnotationError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Error associated with trying to create annotation with Id that already exist + [System.ComponentModel.TypeConverter(typeof(AnnotationErrorTypeConverter))] + public partial interface IAnnotationError + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.TypeConverter.cs new file mode 100644 index 000000000000..d4063d61c79c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AnnotationErrorTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IAnnotationError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AnnotationError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AnnotationError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AnnotationError.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.cs new file mode 100644 index 000000000000..c6b82f1f7de1 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.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.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Error associated with trying to create annotation with Id that already exist + public partial class AnnotationError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal + { + + /// Backing field for property. + private string _code; + + /// Error detail code and explanation + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError _innererror; + + /// Inner error + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError Innererror { get => (this._innererror = this._innererror ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.InnerError()); set => this._innererror = value; } + + /// Provides correlation for request + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string InnererrorDiagnosticcontext { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)Innererror).Diagnosticcontext; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)Innererror).Diagnosticcontext = value ?? null; } + + /// Request time + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public global::System.DateTime? InnererrorTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)Innererror).Time; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)Innererror).Time = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _message; + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Internal Acessors for Innererror + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal.Innererror { get => (this._innererror = this._innererror ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.InnerError()); set { {_innererror = value;} } } + + /// Creates an new instance. + public AnnotationError() + { + + } + } + /// Error associated with trying to create annotation with Id that already exist + public partial interface IAnnotationError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Error detail code and explanation + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error detail code and explanation", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// Provides correlation for request + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provides correlation for request", + SerializedName = @"diagnosticcontext", + PossibleTypes = new [] { typeof(string) })] + string InnererrorDiagnosticcontext { get; set; } + /// Request time + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Request time", + SerializedName = @"time", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InnererrorTime { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// Error associated with trying to create annotation with Id that already exist + internal partial interface IAnnotationErrorInternal + + { + /// Error detail code and explanation + string Code { get; set; } + /// Inner error + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError Innererror { get; set; } + /// Provides correlation for request + string InnererrorDiagnosticcontext { get; set; } + /// Request time + global::System.DateTime? InnererrorTime { get; set; } + /// Error message + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.json.cs new file mode 100644 index 000000000000..672258443807 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.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.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Error associated with trying to create annotation with Id that already exist + public partial class AnnotationError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal AnnotationError(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_innererror = If( json?.PropertyT("innererror"), out var __jsonInnererror) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.InnerError.FromJson(__jsonInnererror) : Innererror;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new AnnotationError(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._innererror ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._innererror.ToJson(null,serializationMode) : null, "innererror" ,container.Add ); + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.PowerShell.cs new file mode 100644 index 000000000000..2b49691af341 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Annotations list result. + [System.ComponentModel.TypeConverter(typeof(AnnotationsListResultTypeConverter))] + public partial class AnnotationsListResult + { + + /// + /// 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 AnnotationsListResult(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.ApplicationInsights.Models.Api20150501.IAnnotationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.AnnotationTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AnnotationsListResult(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.ApplicationInsights.Models.Api20150501.IAnnotationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.AnnotationTypeConverter.ConvertFrom)); + } + 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.ApplicationInsights.Models.Api20150501.IAnnotationsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AnnotationsListResult(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.ApplicationInsights.Models.Api20150501.IAnnotationsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AnnotationsListResult(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.ApplicationInsights.Models.Api20150501.IAnnotationsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Annotations list result. + [System.ComponentModel.TypeConverter(typeof(AnnotationsListResultTypeConverter))] + public partial interface IAnnotationsListResult + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.TypeConverter.cs new file mode 100644 index 000000000000..692b61c3163f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AnnotationsListResultTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IAnnotationsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AnnotationsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AnnotationsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AnnotationsListResult.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.cs new file mode 100644 index 000000000000..177f65974b4c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.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.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Annotations list result. + public partial class AnnotationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResultInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] _value; + + /// An array of annotations. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] Value { get => this._value; } + + /// Creates an new instance. + public AnnotationsListResult() + { + + } + } + /// Annotations list result. + public partial interface IAnnotationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// An array of annotations. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An array of annotations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] Value { get; } + + } + /// Annotations list result. + internal partial interface IAnnotationsListResultInternal + + { + /// An array of annotations. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.json.cs new file mode 100644 index 000000000000..5fed3d17e61a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Annotations list result. + public partial class AnnotationsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal AnnotationsListResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.Annotation.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new AnnotationsListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.PowerShell.cs new file mode 100644 index 000000000000..792f3f8e09b4 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.PowerShell.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component API Key creation request definition. + [System.ComponentModel.TypeConverter(typeof(ApiKeyRequestTypeConverter))] + public partial class ApiKeyRequest + { + + /// + /// 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 ApiKeyRequest(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.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("LinkedReadProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).LinkedReadProperty = (string[]) content.GetValueForProperty("LinkedReadProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).LinkedReadProperty, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LinkedWriteProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).LinkedWriteProperty = (string[]) content.GetValueForProperty("LinkedWriteProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).LinkedWriteProperty, __y => TypeConverterExtensions.SelectToArray(__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 ApiKeyRequest(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.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("LinkedReadProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).LinkedReadProperty = (string[]) content.GetValueForProperty("LinkedReadProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).LinkedReadProperty, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LinkedWriteProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).LinkedWriteProperty = (string[]) content.GetValueForProperty("LinkedWriteProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal)this).LinkedWriteProperty, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + 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.ApplicationInsights.Models.Api20150501.IApiKeyRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApiKeyRequest(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.ApplicationInsights.Models.Api20150501.IApiKeyRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApiKeyRequest(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.ApplicationInsights.Models.Api20150501.IApiKeyRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component API Key creation request definition. + [System.ComponentModel.TypeConverter(typeof(ApiKeyRequestTypeConverter))] + public partial interface IApiKeyRequest + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.TypeConverter.cs new file mode 100644 index 000000000000..a1963ca34988 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApiKeyRequestTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApiKeyRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApiKeyRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApiKeyRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApiKeyRequest.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.cs new file mode 100644 index 000000000000..314a852a958e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component API Key creation request definition. + public partial class ApiKeyRequest : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequestInternal + { + + /// Backing field for property. + private string[] _linkedReadProperty; + + /// The read access rights of this API Key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string[] LinkedReadProperty { get => this._linkedReadProperty; set => this._linkedReadProperty = value; } + + /// Backing field for property. + private string[] _linkedWriteProperty; + + /// The write access rights of this API Key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string[] LinkedWriteProperty { get => this._linkedWriteProperty; set => this._linkedWriteProperty = value; } + + /// Backing field for property. + private string _name; + + /// The name of the API Key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public ApiKeyRequest() + { + + } + } + /// An Application Insights component API Key creation request definition. + public partial interface IApiKeyRequest : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// The read access rights of this API Key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The read access rights of this API Key.", + SerializedName = @"linkedReadProperties", + PossibleTypes = new [] { typeof(string) })] + string[] LinkedReadProperty { get; set; } + /// The write access rights of this API Key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The write access rights of this API Key.", + SerializedName = @"linkedWriteProperties", + PossibleTypes = new [] { typeof(string) })] + string[] LinkedWriteProperty { get; set; } + /// The name of the API Key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the API Key.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// An Application Insights component API Key creation request definition. + internal partial interface IApiKeyRequestInternal + + { + /// The read access rights of this API Key. + string[] LinkedReadProperty { get; set; } + /// The write access rights of this API Key. + string[] LinkedWriteProperty { get; set; } + /// The name of the API Key. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.json.cs new file mode 100644 index 000000000000..c1c1ce9db37c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component API Key creation request definition. + public partial class ApiKeyRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApiKeyRequest(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_linkedReadProperty = If( json?.PropertyT("linkedReadProperties"), out var __jsonLinkedReadProperties) ? If( __jsonLinkedReadProperties as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : LinkedReadProperty;} + {_linkedWriteProperty = If( json?.PropertyT("linkedWriteProperties"), out var __jsonLinkedWriteProperties) ? If( __jsonLinkedWriteProperties as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : LinkedWriteProperty;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApiKeyRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + if (null != this._linkedReadProperty) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __x in this._linkedReadProperty ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("linkedReadProperties",__w); + } + if (null != this._linkedWriteProperty) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __s in this._linkedWriteProperty ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("linkedWriteProperties",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.PowerShell.cs new file mode 100644 index 000000000000..5e1088310ba4 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.PowerShell.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Properties that define an API key of an Application Insights Component. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentApiKeyTypeConverter))] + public partial class ApplicationInsightsComponentApiKey + { + + /// + /// 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 ApplicationInsightsComponentApiKey(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ApiKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).ApiKey, global::System.Convert.ToString); + } + if (content.Contains("CreatedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).CreatedDate = (string) content.GetValueForProperty("CreatedDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).CreatedDate, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("LinkedReadProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty = (string[]) content.GetValueForProperty("LinkedReadProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LinkedWriteProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty = (string[]) content.GetValueForProperty("LinkedWriteProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty, __y => TypeConverterExtensions.SelectToArray(__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 ApplicationInsightsComponentApiKey(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ApiKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).ApiKey, global::System.Convert.ToString); + } + if (content.Contains("CreatedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).CreatedDate = (string) content.GetValueForProperty("CreatedDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).CreatedDate, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("LinkedReadProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty = (string[]) content.GetValueForProperty("LinkedReadProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LinkedWriteProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty = (string[]) content.GetValueForProperty("LinkedWriteProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentApiKey(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentApiKey(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Properties that define an API key of an Application Insights Component. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentApiKeyTypeConverter))] + public partial interface IApplicationInsightsComponentApiKey + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.TypeConverter.cs new file mode 100644 index 000000000000..479c4647a438 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentApiKeyTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentApiKey.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentApiKey.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentApiKey.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.cs new file mode 100644 index 000000000000..a1e1b86c6ff3 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Properties that define an API key of an Application Insights Component. + public partial class ApplicationInsightsComponentApiKey : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal + { + + /// Backing field for property. + private string _apiKey; + + /// The API key value. It will be only return once when the API Key was created. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ApiKey { get => this._apiKey; } + + /// Backing field for property. + private string _createdDate; + + /// The create date of this API key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string CreatedDate { get => this._createdDate; set => this._createdDate = value; } + + /// Backing field for property. + private string _id; + + /// + /// The unique ID of the API key inside an Application Insights component. It is auto generated when the API key is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Backing field for property. + private string[] _linkedReadProperty; + + /// The read access rights of this API Key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string[] LinkedReadProperty { get => this._linkedReadProperty; set => this._linkedReadProperty = value; } + + /// Backing field for property. + private string[] _linkedWriteProperty; + + /// The write access rights of this API Key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string[] LinkedWriteProperty { get => this._linkedWriteProperty; set => this._linkedWriteProperty = value; } + + /// Internal Acessors for ApiKey + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal.ApiKey { get => this._apiKey; set { {_apiKey = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal.Id { get => this._id; set { {_id = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the API key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// Creates an new instance. + public ApplicationInsightsComponentApiKey() + { + + } + } + /// Properties that define an API key of an Application Insights Component. + public partial interface IApplicationInsightsComponentApiKey : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// The API key value. It will be only return once when the API Key was created. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The API key value. It will be only return once when the API Key was created.", + SerializedName = @"apiKey", + PossibleTypes = new [] { typeof(string) })] + string ApiKey { get; } + /// The create date of this API key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The create date of this API key.", + SerializedName = @"createdDate", + PossibleTypes = new [] { typeof(string) })] + string CreatedDate { get; set; } + /// + /// The unique ID of the API key inside an Application Insights component. It is auto generated when the API key is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unique ID of the API key inside an Application Insights component. It is auto generated when the API key is created.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The read access rights of this API Key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The read access rights of this API Key.", + SerializedName = @"linkedReadProperties", + PossibleTypes = new [] { typeof(string) })] + string[] LinkedReadProperty { get; set; } + /// The write access rights of this API Key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The write access rights of this API Key.", + SerializedName = @"linkedWriteProperties", + PossibleTypes = new [] { typeof(string) })] + string[] LinkedWriteProperty { get; set; } + /// The name of the API key. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the API key.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Properties that define an API key of an Application Insights Component. + internal partial interface IApplicationInsightsComponentApiKeyInternal + + { + /// The API key value. It will be only return once when the API Key was created. + string ApiKey { get; set; } + /// The create date of this API key. + string CreatedDate { get; set; } + /// + /// The unique ID of the API key inside an Application Insights component. It is auto generated when the API key is created. + /// + string Id { get; set; } + /// The read access rights of this API Key. + string[] LinkedReadProperty { get; set; } + /// The write access rights of this API Key. + string[] LinkedWriteProperty { get; set; } + /// The name of the API key. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.json.cs new file mode 100644 index 000000000000..8e45c4a24978 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.json.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Properties that define an API key of an Application Insights Component. + public partial class ApplicationInsightsComponentApiKey + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentApiKey(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_apiKey = If( json?.PropertyT("apiKey"), out var __jsonApiKey) ? (string)__jsonApiKey : (string)ApiKey;} + {_createdDate = If( json?.PropertyT("createdDate"), out var __jsonCreatedDate) ? (string)__jsonCreatedDate : (string)CreatedDate;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_linkedReadProperty = If( json?.PropertyT("linkedReadProperties"), out var __jsonLinkedReadProperties) ? If( __jsonLinkedReadProperties as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : LinkedReadProperty;} + {_linkedWriteProperty = If( json?.PropertyT("linkedWriteProperties"), out var __jsonLinkedWriteProperties) ? If( __jsonLinkedWriteProperties as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : LinkedWriteProperty;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentApiKey(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._apiKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._apiKey.ToString()) : null, "apiKey" ,container.Add ); + } + AddIf( null != (((object)this._createdDate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._createdDate.ToString()) : null, "createdDate" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + if (null != this._linkedReadProperty) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __x in this._linkedReadProperty ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("linkedReadProperties",__w); + } + if (null != this._linkedWriteProperty) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __s in this._linkedWriteProperty ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("linkedWriteProperties",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.PowerShell.cs new file mode 100644 index 000000000000..885f28df106d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.PowerShell.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Describes the list of API Keys of an Application Insights Component. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentApiKeyListResultTypeConverter))] + public partial class ApplicationInsightsComponentApiKeyListResult + { + + /// + /// 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 ApplicationInsightsComponentApiKeyListResult(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentApiKeyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentApiKeyListResult(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentApiKeyTypeConverter.ConvertFrom)); + } + 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentApiKeyListResult(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentApiKeyListResult(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Describes the list of API Keys of an Application Insights Component. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentApiKeyListResultTypeConverter))] + public partial interface IApplicationInsightsComponentApiKeyListResult + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.TypeConverter.cs new file mode 100644 index 000000000000..088a48c5a05f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentApiKeyListResultTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentApiKeyListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentApiKeyListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentApiKeyListResult.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.cs new file mode 100644 index 000000000000..a5e3061ebbf6 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Describes the list of API Keys of an Application Insights Component. + public partial class ApplicationInsightsComponentApiKeyListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[] _value; + + /// List of API Key definitions. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[] Value { get => this._value; set => this._value = value; } + + /// + /// Creates an new instance. + /// + public ApplicationInsightsComponentApiKeyListResult() + { + + } + } + /// Describes the list of API Keys of an Application Insights Component. + public partial interface IApplicationInsightsComponentApiKeyListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// List of API Key definitions. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of API Key definitions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[] Value { get; set; } + + } + /// Describes the list of API Keys of an Application Insights Component. + internal partial interface IApplicationInsightsComponentApiKeyListResultInternal + + { + /// List of API Key definitions. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.json.cs new file mode 100644 index 000000000000..1aaf21dad1c9 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Describes the list of API Keys of an Application Insights Component. + public partial class ApplicationInsightsComponentApiKeyListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentApiKeyListResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentApiKey.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentApiKeyListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.PowerShell.cs new file mode 100644 index 000000000000..d22445a27aa9 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.PowerShell.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component available features. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentAvailableFeaturesTypeConverter))] + public partial class ApplicationInsightsComponentAvailableFeatures + { + + /// + /// 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 ApplicationInsightsComponentAvailableFeatures(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Result")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeaturesInternal)this).Result = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[]) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeaturesInternal)this).Result, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentAvailableFeatures(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Result")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeaturesInternal)this).Result = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[]) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeaturesInternal)this).Result, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureTypeConverter.ConvertFrom)); + } + 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentAvailableFeatures(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentAvailableFeatures(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component available features. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentAvailableFeaturesTypeConverter))] + public partial interface IApplicationInsightsComponentAvailableFeatures + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.TypeConverter.cs new file mode 100644 index 000000000000..9529da3d1000 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentAvailableFeaturesTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentAvailableFeatures.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentAvailableFeatures.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentAvailableFeatures.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.cs new file mode 100644 index 000000000000..a204b1daa06c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component available features. + public partial class ApplicationInsightsComponentAvailableFeatures : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeaturesInternal + { + + /// Internal Acessors for Result + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeaturesInternal.Result { get => this._result; set { {_result = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] _result; + + /// A list of Application Insights component feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] Result { get => this._result; } + + /// + /// Creates an new instance. + /// + public ApplicationInsightsComponentAvailableFeatures() + { + + } + } + /// An Application Insights component available features. + public partial interface IApplicationInsightsComponentAvailableFeatures : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// A list of Application Insights component feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A list of Application Insights component feature.", + SerializedName = @"Result", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] Result { get; } + + } + /// An Application Insights component available features. + internal partial interface IApplicationInsightsComponentAvailableFeaturesInternal + + { + /// A list of Application Insights component feature. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] Result { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.json.cs new file mode 100644 index 000000000000..21e0d23e069a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component available features. + public partial class ApplicationInsightsComponentAvailableFeatures + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentAvailableFeatures(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_result = If( json?.PropertyT("Result"), out var __jsonResult) ? If( __jsonResult as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeature.FromJson(__u) )) ))() : null : Result;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentAvailableFeatures(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._result) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __x in this._result ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("Result",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.PowerShell.cs new file mode 100644 index 000000000000..431a577f124d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.PowerShell.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component billing features + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentBillingFeaturesTypeConverter))] + public partial class ApplicationInsightsComponentBillingFeatures + { + + /// + /// 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 ApplicationInsightsComponentBillingFeatures(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataVolumeCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap) content.GetValueForProperty("DataVolumeCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCapTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentBillingFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature = (string[]) content.GetValueForProperty("CurrentBillingFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DataVolumeCapCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapCap = (float?) content.GetValueForProperty("DataVolumeCapCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DataVolumeCapResetTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapResetTime = (int?) content.GetValueForProperty("DataVolumeCapResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapResetTime, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DataVolumeCapWarningThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapWarningThreshold = (int?) content.GetValueForProperty("DataVolumeCapWarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapWarningThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DataVolumeCapStopSendNotificationWhenHitThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitThreshold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataVolumeCapStopSendNotificationWhenHitCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitCap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataVolumeCapMaxHistoryCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap = (float?) content.GetValueForProperty("DataVolumeCapMaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentBillingFeatures(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataVolumeCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap) content.GetValueForProperty("DataVolumeCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCapTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentBillingFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature = (string[]) content.GetValueForProperty("CurrentBillingFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DataVolumeCapCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapCap = (float?) content.GetValueForProperty("DataVolumeCapCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DataVolumeCapResetTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapResetTime = (int?) content.GetValueForProperty("DataVolumeCapResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapResetTime, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DataVolumeCapWarningThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapWarningThreshold = (int?) content.GetValueForProperty("DataVolumeCapWarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapWarningThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DataVolumeCapStopSendNotificationWhenHitThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitThreshold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataVolumeCapStopSendNotificationWhenHitCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitCap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DataVolumeCapMaxHistoryCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap = (float?) content.GetValueForProperty("DataVolumeCapMaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentBillingFeatures(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentBillingFeatures(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component billing features + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentBillingFeaturesTypeConverter))] + public partial interface IApplicationInsightsComponentBillingFeatures + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.TypeConverter.cs new file mode 100644 index 000000000000..6baeace95ed8 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentBillingFeaturesTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentBillingFeatures.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentBillingFeatures.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentBillingFeatures.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.cs new file mode 100644 index 000000000000..b2b55374ca33 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.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.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component billing features + public partial class ApplicationInsightsComponentBillingFeatures : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal + { + + /// Backing field for property. + private string[] _currentBillingFeature; + + /// + /// Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application + /// Insights Enterprise'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string[] CurrentBillingFeature { get => this._currentBillingFeature; set => this._currentBillingFeature = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap _dataVolumeCap; + + /// An Application Insights component daily data volume cap + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap DataVolumeCap { get => (this._dataVolumeCap = this._dataVolumeCap ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCap()); set => this._dataVolumeCap = value; } + + /// Daily data volume cap in GB. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public float? DataVolumeCapCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).Cap; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).Cap = value ?? default(float); } + + /// Maximum daily data volume cap that the user can set for this component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public float? DataVolumeCapMaxHistoryCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).MaxHistoryCap; } + + /// Daily data volume cap UTC reset hour. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public int? DataVolumeCapResetTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).ResetTime; } + + /// Do not send a notification email when the daily data volume cap is met. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public bool? DataVolumeCapStopSendNotificationWhenHitCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).StopSendNotificationWhenHitCap; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).StopSendNotificationWhenHitCap = value ?? default(bool); } + + /// Reserved, not used for now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public bool? DataVolumeCapStopSendNotificationWhenHitThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).StopSendNotificationWhenHitThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).StopSendNotificationWhenHitThreshold = value ?? default(bool); } + + /// Reserved, not used for now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public int? DataVolumeCapWarningThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).WarningThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).WarningThreshold = value ?? default(int); } + + /// Internal Acessors for DataVolumeCap + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal.DataVolumeCap { get => (this._dataVolumeCap = this._dataVolumeCap ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCap()); set { {_dataVolumeCap = value;} } } + + /// Internal Acessors for DataVolumeCapMaxHistoryCap + float? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal.DataVolumeCapMaxHistoryCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).MaxHistoryCap; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).MaxHistoryCap = value; } + + /// Internal Acessors for DataVolumeCapResetTime + int? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal.DataVolumeCapResetTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).ResetTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).ResetTime = value; } + + /// + /// Creates an new instance. + /// + public ApplicationInsightsComponentBillingFeatures() + { + + } + } + /// An Application Insights component billing features + public partial interface IApplicationInsightsComponentBillingFeatures : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// + /// Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application + /// Insights Enterprise'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'.", + SerializedName = @"CurrentBillingFeatures", + PossibleTypes = new [] { typeof(string) })] + string[] CurrentBillingFeature { get; set; } + /// Daily data volume cap in GB. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Daily data volume cap in GB.", + SerializedName = @"Cap", + PossibleTypes = new [] { typeof(float) })] + float? DataVolumeCapCap { get; set; } + /// Maximum daily data volume cap that the user can set for this component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Maximum daily data volume cap that the user can set for this component.", + SerializedName = @"MaxHistoryCap", + PossibleTypes = new [] { typeof(float) })] + float? DataVolumeCapMaxHistoryCap { get; } + /// Daily data volume cap UTC reset hour. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Daily data volume cap UTC reset hour.", + SerializedName = @"ResetTime", + PossibleTypes = new [] { typeof(int) })] + int? DataVolumeCapResetTime { get; } + /// Do not send a notification email when the daily data volume cap is met. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Do not send a notification email when the daily data volume cap is met.", + SerializedName = @"StopSendNotificationWhenHitCap", + PossibleTypes = new [] { typeof(bool) })] + bool? DataVolumeCapStopSendNotificationWhenHitCap { get; set; } + /// Reserved, not used for now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reserved, not used for now.", + SerializedName = @"StopSendNotificationWhenHitThreshold", + PossibleTypes = new [] { typeof(bool) })] + bool? DataVolumeCapStopSendNotificationWhenHitThreshold { get; set; } + /// Reserved, not used for now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reserved, not used for now.", + SerializedName = @"WarningThreshold", + PossibleTypes = new [] { typeof(int) })] + int? DataVolumeCapWarningThreshold { get; set; } + + } + /// An Application Insights component billing features + internal partial interface IApplicationInsightsComponentBillingFeaturesInternal + + { + /// + /// Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application + /// Insights Enterprise'. + /// + string[] CurrentBillingFeature { get; set; } + /// An Application Insights component daily data volume cap + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap DataVolumeCap { get; set; } + /// Daily data volume cap in GB. + float? DataVolumeCapCap { get; set; } + /// Maximum daily data volume cap that the user can set for this component. + float? DataVolumeCapMaxHistoryCap { get; set; } + /// Daily data volume cap UTC reset hour. + int? DataVolumeCapResetTime { get; set; } + /// Do not send a notification email when the daily data volume cap is met. + bool? DataVolumeCapStopSendNotificationWhenHitCap { get; set; } + /// Reserved, not used for now. + bool? DataVolumeCapStopSendNotificationWhenHitThreshold { get; set; } + /// Reserved, not used for now. + int? DataVolumeCapWarningThreshold { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.json.cs new file mode 100644 index 000000000000..4e7fb279e3d6 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component billing features + public partial class ApplicationInsightsComponentBillingFeatures + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentBillingFeatures(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_dataVolumeCap = If( json?.PropertyT("DataVolumeCap"), out var __jsonDataVolumeCap) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCap.FromJson(__jsonDataVolumeCap) : DataVolumeCap;} + {_currentBillingFeature = If( json?.PropertyT("CurrentBillingFeatures"), out var __jsonCurrentBillingFeatures) ? If( __jsonCurrentBillingFeatures as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : CurrentBillingFeature;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentBillingFeatures(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._dataVolumeCap ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._dataVolumeCap.ToJson(null,serializationMode) : null, "DataVolumeCap" ,container.Add ); + if (null != this._currentBillingFeature) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __x in this._currentBillingFeature ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("CurrentBillingFeatures",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs new file mode 100644 index 000000000000..6f919af6d598 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component daily data volume cap + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentDataVolumeCapTypeConverter))] + public partial class ApplicationInsightsComponentDataVolumeCap + { + + /// + /// 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 ApplicationInsightsComponentDataVolumeCap(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).Cap = (float?) content.GetValueForProperty("Cap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).Cap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResetTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).ResetTime = (int?) content.GetValueForProperty("ResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).ResetTime, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WarningThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).WarningThreshold = (int?) content.GetValueForProperty("WarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).WarningThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StopSendNotificationWhenHitThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitThreshold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("StopSendNotificationWhenHitCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitCap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MaxHistoryCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap = (float?) content.GetValueForProperty("MaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentDataVolumeCap(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).Cap = (float?) content.GetValueForProperty("Cap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).Cap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResetTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).ResetTime = (int?) content.GetValueForProperty("ResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).ResetTime, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WarningThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).WarningThreshold = (int?) content.GetValueForProperty("WarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).WarningThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StopSendNotificationWhenHitThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitThreshold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("StopSendNotificationWhenHitCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitCap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MaxHistoryCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap = (float?) content.GetValueForProperty("MaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentDataVolumeCap(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentDataVolumeCap(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component daily data volume cap + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentDataVolumeCapTypeConverter))] + public partial interface IApplicationInsightsComponentDataVolumeCap + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.TypeConverter.cs new file mode 100644 index 000000000000..891327450cd1 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentDataVolumeCapTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentDataVolumeCap.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentDataVolumeCap.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentDataVolumeCap.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.cs new file mode 100644 index 000000000000..a24fff7b087e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component daily data volume cap + public partial class ApplicationInsightsComponentDataVolumeCap : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal + { + + /// Backing field for property. + private float? _cap; + + /// Daily data volume cap in GB. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public float? Cap { get => this._cap; set => this._cap = value; } + + /// Backing field for property. + private float? _maxHistoryCap; + + /// Maximum daily data volume cap that the user can set for this component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public float? MaxHistoryCap { get => this._maxHistoryCap; } + + /// Internal Acessors for MaxHistoryCap + float? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal.MaxHistoryCap { get => this._maxHistoryCap; set { {_maxHistoryCap = value;} } } + + /// Internal Acessors for ResetTime + int? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal.ResetTime { get => this._resetTime; set { {_resetTime = value;} } } + + /// Backing field for property. + private int? _resetTime; + + /// Daily data volume cap UTC reset hour. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public int? ResetTime { get => this._resetTime; } + + /// Backing field for property. + private bool? _stopSendNotificationWhenHitCap; + + /// Do not send a notification email when the daily data volume cap is met. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? StopSendNotificationWhenHitCap { get => this._stopSendNotificationWhenHitCap; set => this._stopSendNotificationWhenHitCap = value; } + + /// Backing field for property. + private bool? _stopSendNotificationWhenHitThreshold; + + /// Reserved, not used for now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? StopSendNotificationWhenHitThreshold { get => this._stopSendNotificationWhenHitThreshold; set => this._stopSendNotificationWhenHitThreshold = value; } + + /// Backing field for property. + private int? _warningThreshold; + + /// Reserved, not used for now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public int? WarningThreshold { get => this._warningThreshold; set => this._warningThreshold = value; } + + /// + /// Creates an new instance. + /// + public ApplicationInsightsComponentDataVolumeCap() + { + + } + } + /// An Application Insights component daily data volume cap + public partial interface IApplicationInsightsComponentDataVolumeCap : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Daily data volume cap in GB. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Daily data volume cap in GB.", + SerializedName = @"Cap", + PossibleTypes = new [] { typeof(float) })] + float? Cap { get; set; } + /// Maximum daily data volume cap that the user can set for this component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Maximum daily data volume cap that the user can set for this component.", + SerializedName = @"MaxHistoryCap", + PossibleTypes = new [] { typeof(float) })] + float? MaxHistoryCap { get; } + /// Daily data volume cap UTC reset hour. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Daily data volume cap UTC reset hour.", + SerializedName = @"ResetTime", + PossibleTypes = new [] { typeof(int) })] + int? ResetTime { get; } + /// Do not send a notification email when the daily data volume cap is met. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Do not send a notification email when the daily data volume cap is met.", + SerializedName = @"StopSendNotificationWhenHitCap", + PossibleTypes = new [] { typeof(bool) })] + bool? StopSendNotificationWhenHitCap { get; set; } + /// Reserved, not used for now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reserved, not used for now.", + SerializedName = @"StopSendNotificationWhenHitThreshold", + PossibleTypes = new [] { typeof(bool) })] + bool? StopSendNotificationWhenHitThreshold { get; set; } + /// Reserved, not used for now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reserved, not used for now.", + SerializedName = @"WarningThreshold", + PossibleTypes = new [] { typeof(int) })] + int? WarningThreshold { get; set; } + + } + /// An Application Insights component daily data volume cap + internal partial interface IApplicationInsightsComponentDataVolumeCapInternal + + { + /// Daily data volume cap in GB. + float? Cap { get; set; } + /// Maximum daily data volume cap that the user can set for this component. + float? MaxHistoryCap { get; set; } + /// Daily data volume cap UTC reset hour. + int? ResetTime { get; set; } + /// Do not send a notification email when the daily data volume cap is met. + bool? StopSendNotificationWhenHitCap { get; set; } + /// Reserved, not used for now. + bool? StopSendNotificationWhenHitThreshold { get; set; } + /// Reserved, not used for now. + int? WarningThreshold { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.json.cs new file mode 100644 index 000000000000..ac61a2283f27 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component daily data volume cap + public partial class ApplicationInsightsComponentDataVolumeCap + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentDataVolumeCap(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_cap = If( json?.PropertyT("Cap"), out var __jsonCap) ? (float?)__jsonCap : Cap;} + {_resetTime = If( json?.PropertyT("ResetTime"), out var __jsonResetTime) ? (int?)__jsonResetTime : ResetTime;} + {_warningThreshold = If( json?.PropertyT("WarningThreshold"), out var __jsonWarningThreshold) ? (int?)__jsonWarningThreshold : WarningThreshold;} + {_stopSendNotificationWhenHitThreshold = If( json?.PropertyT("StopSendNotificationWhenHitThreshold"), out var __jsonStopSendNotificationWhenHitThreshold) ? (bool?)__jsonStopSendNotificationWhenHitThreshold : StopSendNotificationWhenHitThreshold;} + {_stopSendNotificationWhenHitCap = If( json?.PropertyT("StopSendNotificationWhenHitCap"), out var __jsonStopSendNotificationWhenHitCap) ? (bool?)__jsonStopSendNotificationWhenHitCap : StopSendNotificationWhenHitCap;} + {_maxHistoryCap = If( json?.PropertyT("MaxHistoryCap"), out var __jsonMaxHistoryCap) ? (float?)__jsonMaxHistoryCap : MaxHistoryCap;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentDataVolumeCap(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._cap ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNumber((float)this._cap) : null, "Cap" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._resetTime ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNumber((int)this._resetTime) : null, "ResetTime" ,container.Add ); + } + AddIf( null != this._warningThreshold ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNumber((int)this._warningThreshold) : null, "WarningThreshold" ,container.Add ); + AddIf( null != this._stopSendNotificationWhenHitThreshold ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._stopSendNotificationWhenHitThreshold) : null, "StopSendNotificationWhenHitThreshold" ,container.Add ); + AddIf( null != this._stopSendNotificationWhenHitCap ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._stopSendNotificationWhenHitCap) : null, "StopSendNotificationWhenHitCap" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._maxHistoryCap ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNumber((float)this._maxHistoryCap) : null, "MaxHistoryCap" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.PowerShell.cs new file mode 100644 index 000000000000..4dd2fde810ef --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.PowerShell.cs @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Properties that define a Continuous Export configuration. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentExportConfigurationTypeConverter))] + public partial class ApplicationInsightsComponentExportConfiguration + { + + /// + /// 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 ApplicationInsightsComponentExportConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExportId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ExportId = (string) content.GetValueForProperty("ExportId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ExportId, global::System.Convert.ToString); + } + if (content.Contains("InstrumentationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).InstrumentationKey, global::System.Convert.ToString); + } + if (content.Contains("RecordType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).RecordType = (string) content.GetValueForProperty("RecordType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).RecordType, global::System.Convert.ToString); + } + if (content.Contains("ApplicationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ApplicationName = (string) content.GetValueForProperty("ApplicationName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ApplicationName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageSubscriptionId = (string) content.GetValueForProperty("DestinationStorageSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageLocationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageLocationId = (string) content.GetValueForProperty("DestinationStorageLocationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageLocationId, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationAccountId = (string) content.GetValueForProperty("DestinationAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationAccountId, global::System.Convert.ToString); + } + if (content.Contains("DestinationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationType = (string) content.GetValueForProperty("DestinationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationType, global::System.Convert.ToString); + } + if (content.Contains("IsUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).IsUserEnabled = (string) content.GetValueForProperty("IsUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).IsUserEnabled, global::System.Convert.ToString); + } + if (content.Contains("LastUserUpdate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastUserUpdate = (string) content.GetValueForProperty("LastUserUpdate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastUserUpdate, global::System.Convert.ToString); + } + if (content.Contains("NotificationQueueEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).NotificationQueueEnabled = (string) content.GetValueForProperty("NotificationQueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).NotificationQueueEnabled, global::System.Convert.ToString); + } + if (content.Contains("ExportStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ExportStatus = (string) content.GetValueForProperty("ExportStatus",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ExportStatus, global::System.Convert.ToString); + } + if (content.Contains("LastSuccessTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastSuccessTime = (string) content.GetValueForProperty("LastSuccessTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastSuccessTime, global::System.Convert.ToString); + } + if (content.Contains("LastGapTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastGapTime = (string) content.GetValueForProperty("LastGapTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastGapTime, global::System.Convert.ToString); + } + if (content.Contains("PermanentErrorReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).PermanentErrorReason = (string) content.GetValueForProperty("PermanentErrorReason",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).PermanentErrorReason, global::System.Convert.ToString); + } + if (content.Contains("StorageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).StorageName = (string) content.GetValueForProperty("StorageName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).StorageName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ContainerName, 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 ApplicationInsightsComponentExportConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExportId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ExportId = (string) content.GetValueForProperty("ExportId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ExportId, global::System.Convert.ToString); + } + if (content.Contains("InstrumentationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).InstrumentationKey, global::System.Convert.ToString); + } + if (content.Contains("RecordType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).RecordType = (string) content.GetValueForProperty("RecordType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).RecordType, global::System.Convert.ToString); + } + if (content.Contains("ApplicationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ApplicationName = (string) content.GetValueForProperty("ApplicationName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ApplicationName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageSubscriptionId = (string) content.GetValueForProperty("DestinationStorageSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageLocationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageLocationId = (string) content.GetValueForProperty("DestinationStorageLocationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageLocationId, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationAccountId = (string) content.GetValueForProperty("DestinationAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationAccountId, global::System.Convert.ToString); + } + if (content.Contains("DestinationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationType = (string) content.GetValueForProperty("DestinationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationType, global::System.Convert.ToString); + } + if (content.Contains("IsUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).IsUserEnabled = (string) content.GetValueForProperty("IsUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).IsUserEnabled, global::System.Convert.ToString); + } + if (content.Contains("LastUserUpdate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastUserUpdate = (string) content.GetValueForProperty("LastUserUpdate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastUserUpdate, global::System.Convert.ToString); + } + if (content.Contains("NotificationQueueEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).NotificationQueueEnabled = (string) content.GetValueForProperty("NotificationQueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).NotificationQueueEnabled, global::System.Convert.ToString); + } + if (content.Contains("ExportStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ExportStatus = (string) content.GetValueForProperty("ExportStatus",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ExportStatus, global::System.Convert.ToString); + } + if (content.Contains("LastSuccessTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastSuccessTime = (string) content.GetValueForProperty("LastSuccessTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastSuccessTime, global::System.Convert.ToString); + } + if (content.Contains("LastGapTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastGapTime = (string) content.GetValueForProperty("LastGapTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).LastGapTime, global::System.Convert.ToString); + } + if (content.Contains("PermanentErrorReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).PermanentErrorReason = (string) content.GetValueForProperty("PermanentErrorReason",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).PermanentErrorReason, global::System.Convert.ToString); + } + if (content.Contains("StorageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).StorageName = (string) content.GetValueForProperty("StorageName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).StorageName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal)this).ContainerName, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentExportConfiguration(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentExportConfiguration(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Properties that define a Continuous Export configuration. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentExportConfigurationTypeConverter))] + public partial interface IApplicationInsightsComponentExportConfiguration + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..8095fa2edc1b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentExportConfigurationTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentExportConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentExportConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentExportConfiguration.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.cs new file mode 100644 index 000000000000..558cb00ea510 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.cs @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Properties that define a Continuous Export configuration. + public partial class ApplicationInsightsComponentExportConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal + { + + /// Backing field for property. + private string _applicationName; + + /// The name of the Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ApplicationName { get => this._applicationName; } + + /// Backing field for property. + private string _containerName; + + /// The name of the destination storage container. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; } + + /// Backing field for property. + private string _destinationAccountId; + + /// The name of destination account. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string DestinationAccountId { get => this._destinationAccountId; } + + /// Backing field for property. + private string _destinationStorageLocationId; + + /// The destination account location ID. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string DestinationStorageLocationId { get => this._destinationStorageLocationId; } + + /// Backing field for property. + private string _destinationStorageSubscriptionId; + + /// The destination storage account subscription ID. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string DestinationStorageSubscriptionId { get => this._destinationStorageSubscriptionId; } + + /// Backing field for property. + private string _destinationType; + + /// The destination type. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string DestinationType { get => this._destinationType; } + + /// Backing field for property. + private string _exportId; + + /// + /// The unique ID of the export configuration inside an Application Insights component. It is auto generated when the Continuous + /// Export configuration is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ExportId { get => this._exportId; } + + /// Backing field for property. + private string _exportStatus; + + /// + /// This indicates current Continuous Export configuration status. The possible values are 'Preparing', 'Success', 'Failure'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ExportStatus { get => this._exportStatus; } + + /// Backing field for property. + private string _instrumentationKey; + + /// The instrumentation key of the Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string InstrumentationKey { get => this._instrumentationKey; } + + /// Backing field for property. + private string _isUserEnabled; + + /// + /// This will be 'true' if the Continuous Export configuration is enabled, otherwise it will be 'false'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string IsUserEnabled { get => this._isUserEnabled; } + + /// Backing field for property. + private string _lastGapTime; + + /// The last time the Continuous Export configuration started failing. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string LastGapTime { get => this._lastGapTime; } + + /// Backing field for property. + private string _lastSuccessTime; + + /// + /// The last time data was successfully delivered to the destination storage container for this Continuous Export configuration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string LastSuccessTime { get => this._lastSuccessTime; } + + /// Backing field for property. + private string _lastUserUpdate; + + /// Last time the Continuous Export configuration was updated. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string LastUserUpdate { get => this._lastUserUpdate; } + + /// Internal Acessors for ApplicationName + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.ApplicationName { get => this._applicationName; set { {_applicationName = value;} } } + + /// Internal Acessors for ContainerName + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.ContainerName { get => this._containerName; set { {_containerName = value;} } } + + /// Internal Acessors for DestinationAccountId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.DestinationAccountId { get => this._destinationAccountId; set { {_destinationAccountId = value;} } } + + /// Internal Acessors for DestinationStorageLocationId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.DestinationStorageLocationId { get => this._destinationStorageLocationId; set { {_destinationStorageLocationId = value;} } } + + /// Internal Acessors for DestinationStorageSubscriptionId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.DestinationStorageSubscriptionId { get => this._destinationStorageSubscriptionId; set { {_destinationStorageSubscriptionId = value;} } } + + /// Internal Acessors for DestinationType + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.DestinationType { get => this._destinationType; set { {_destinationType = value;} } } + + /// Internal Acessors for ExportId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.ExportId { get => this._exportId; set { {_exportId = value;} } } + + /// Internal Acessors for ExportStatus + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.ExportStatus { get => this._exportStatus; set { {_exportStatus = value;} } } + + /// Internal Acessors for InstrumentationKey + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.InstrumentationKey { get => this._instrumentationKey; set { {_instrumentationKey = value;} } } + + /// Internal Acessors for IsUserEnabled + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.IsUserEnabled { get => this._isUserEnabled; set { {_isUserEnabled = value;} } } + + /// Internal Acessors for LastGapTime + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.LastGapTime { get => this._lastGapTime; set { {_lastGapTime = value;} } } + + /// Internal Acessors for LastSuccessTime + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.LastSuccessTime { get => this._lastSuccessTime; set { {_lastSuccessTime = value;} } } + + /// Internal Acessors for LastUserUpdate + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.LastUserUpdate { get => this._lastUserUpdate; set { {_lastUserUpdate = value;} } } + + /// Internal Acessors for PermanentErrorReason + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.PermanentErrorReason { get => this._permanentErrorReason; set { {_permanentErrorReason = value;} } } + + /// Internal Acessors for ResourceGroup + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.ResourceGroup { get => this._resourceGroup; set { {_resourceGroup = value;} } } + + /// Internal Acessors for StorageName + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.StorageName { get => this._storageName; set { {_storageName = value;} } } + + /// Internal Acessors for SubscriptionId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfigurationInternal.SubscriptionId { get => this._subscriptionId; set { {_subscriptionId = value;} } } + + /// Backing field for property. + private string _notificationQueueEnabled; + + /// Deprecated + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string NotificationQueueEnabled { get => this._notificationQueueEnabled; set => this._notificationQueueEnabled = value; } + + /// Backing field for property. + private string _permanentErrorReason; + + /// + /// This is the reason the Continuous Export configuration started failing. It can be 'AzureStorageNotFound' or 'AzureStorageAccessDenied'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string PermanentErrorReason { get => this._permanentErrorReason; } + + /// Backing field for property. + private string _recordType; + + /// + /// This comma separated list of document types that will be exported. The possible values include 'Requests', 'Event', 'Exceptions', + /// 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string RecordType { get => this._recordType; set => this._recordType = value; } + + /// Backing field for property. + private string _resourceGroup; + + /// The resource group of the Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ResourceGroup { get => this._resourceGroup; } + + /// Backing field for property. + private string _storageName; + + /// The name of the destination storage account. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string StorageName { get => this._storageName; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription of the Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; } + + /// + /// Creates an new instance. + /// + public ApplicationInsightsComponentExportConfiguration() + { + + } + } + /// Properties that define a Continuous Export configuration. + public partial interface IApplicationInsightsComponentExportConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// The name of the Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the Application Insights component.", + SerializedName = @"ApplicationName", + PossibleTypes = new [] { typeof(string) })] + string ApplicationName { get; } + /// The name of the destination storage container. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the destination storage container.", + SerializedName = @"ContainerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; } + /// The name of destination account. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of destination account.", + SerializedName = @"DestinationAccountId", + PossibleTypes = new [] { typeof(string) })] + string DestinationAccountId { get; } + /// The destination account location ID. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The destination account location ID.", + SerializedName = @"DestinationStorageLocationId", + PossibleTypes = new [] { typeof(string) })] + string DestinationStorageLocationId { get; } + /// The destination storage account subscription ID. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The destination storage account subscription ID.", + SerializedName = @"DestinationStorageSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string DestinationStorageSubscriptionId { get; } + /// The destination type. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The destination type.", + SerializedName = @"DestinationType", + PossibleTypes = new [] { typeof(string) })] + string DestinationType { get; } + /// + /// The unique ID of the export configuration inside an Application Insights component. It is auto generated when the Continuous + /// Export configuration is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unique ID of the export configuration inside an Application Insights component. It is auto generated when the Continuous Export configuration is created.", + SerializedName = @"ExportId", + PossibleTypes = new [] { typeof(string) })] + string ExportId { get; } + /// + /// This indicates current Continuous Export configuration status. The possible values are 'Preparing', 'Success', 'Failure'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This indicates current Continuous Export configuration status. The possible values are 'Preparing', 'Success', 'Failure'.", + SerializedName = @"ExportStatus", + PossibleTypes = new [] { typeof(string) })] + string ExportStatus { get; } + /// The instrumentation key of the Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The instrumentation key of the Application Insights component.", + SerializedName = @"InstrumentationKey", + PossibleTypes = new [] { typeof(string) })] + string InstrumentationKey { get; } + /// + /// This will be 'true' if the Continuous Export configuration is enabled, otherwise it will be 'false'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This will be 'true' if the Continuous Export configuration is enabled, otherwise it will be 'false'.", + SerializedName = @"IsUserEnabled", + PossibleTypes = new [] { typeof(string) })] + string IsUserEnabled { get; } + /// The last time the Continuous Export configuration started failing. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The last time the Continuous Export configuration started failing.", + SerializedName = @"LastGapTime", + PossibleTypes = new [] { typeof(string) })] + string LastGapTime { get; } + /// + /// The last time data was successfully delivered to the destination storage container for this Continuous Export configuration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The last time data was successfully delivered to the destination storage container for this Continuous Export configuration.", + SerializedName = @"LastSuccessTime", + PossibleTypes = new [] { typeof(string) })] + string LastSuccessTime { get; } + /// Last time the Continuous Export configuration was updated. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last time the Continuous Export configuration was updated.", + SerializedName = @"LastUserUpdate", + PossibleTypes = new [] { typeof(string) })] + string LastUserUpdate { get; } + /// Deprecated + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Deprecated", + SerializedName = @"NotificationQueueEnabled", + PossibleTypes = new [] { typeof(string) })] + string NotificationQueueEnabled { get; set; } + /// + /// This is the reason the Continuous Export configuration started failing. It can be 'AzureStorageNotFound' or 'AzureStorageAccessDenied'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is the reason the Continuous Export configuration started failing. It can be 'AzureStorageNotFound' or 'AzureStorageAccessDenied'.", + SerializedName = @"PermanentErrorReason", + PossibleTypes = new [] { typeof(string) })] + string PermanentErrorReason { get; } + /// + /// This comma separated list of document types that will be exported. The possible values include 'Requests', 'Event', 'Exceptions', + /// 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This comma separated list of document types that will be exported. The possible values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'.", + SerializedName = @"RecordTypes", + PossibleTypes = new [] { typeof(string) })] + string RecordType { get; set; } + /// The resource group of the Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The resource group of the Application Insights component.", + SerializedName = @"ResourceGroup", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroup { get; } + /// The name of the destination storage account. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the destination storage account.", + SerializedName = @"StorageName", + PossibleTypes = new [] { typeof(string) })] + string StorageName { get; } + /// The subscription of the Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The subscription of the Application Insights component.", + SerializedName = @"SubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; } + + } + /// Properties that define a Continuous Export configuration. + internal partial interface IApplicationInsightsComponentExportConfigurationInternal + + { + /// The name of the Application Insights component. + string ApplicationName { get; set; } + /// The name of the destination storage container. + string ContainerName { get; set; } + /// The name of destination account. + string DestinationAccountId { get; set; } + /// The destination account location ID. + string DestinationStorageLocationId { get; set; } + /// The destination storage account subscription ID. + string DestinationStorageSubscriptionId { get; set; } + /// The destination type. + string DestinationType { get; set; } + /// + /// The unique ID of the export configuration inside an Application Insights component. It is auto generated when the Continuous + /// Export configuration is created. + /// + string ExportId { get; set; } + /// + /// This indicates current Continuous Export configuration status. The possible values are 'Preparing', 'Success', 'Failure'. + /// + string ExportStatus { get; set; } + /// The instrumentation key of the Application Insights component. + string InstrumentationKey { get; set; } + /// + /// This will be 'true' if the Continuous Export configuration is enabled, otherwise it will be 'false'. + /// + string IsUserEnabled { get; set; } + /// The last time the Continuous Export configuration started failing. + string LastGapTime { get; set; } + /// + /// The last time data was successfully delivered to the destination storage container for this Continuous Export configuration. + /// + string LastSuccessTime { get; set; } + /// Last time the Continuous Export configuration was updated. + string LastUserUpdate { get; set; } + /// Deprecated + string NotificationQueueEnabled { get; set; } + /// + /// This is the reason the Continuous Export configuration started failing. It can be 'AzureStorageNotFound' or 'AzureStorageAccessDenied'. + /// + string PermanentErrorReason { get; set; } + /// + /// This comma separated list of document types that will be exported. The possible values include 'Requests', 'Event', 'Exceptions', + /// 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + /// + string RecordType { get; set; } + /// The resource group of the Application Insights component. + string ResourceGroup { get; set; } + /// The name of the destination storage account. + string StorageName { get; set; } + /// The subscription of the Application Insights component. + string SubscriptionId { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.json.cs new file mode 100644 index 000000000000..0f727d1579e4 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.json.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.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Properties that define a Continuous Export configuration. + public partial class ApplicationInsightsComponentExportConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentExportConfiguration(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_exportId = If( json?.PropertyT("ExportId"), out var __jsonExportId) ? (string)__jsonExportId : (string)ExportId;} + {_instrumentationKey = If( json?.PropertyT("InstrumentationKey"), out var __jsonInstrumentationKey) ? (string)__jsonInstrumentationKey : (string)InstrumentationKey;} + {_recordType = If( json?.PropertyT("RecordTypes"), out var __jsonRecordTypes) ? (string)__jsonRecordTypes : (string)RecordType;} + {_applicationName = If( json?.PropertyT("ApplicationName"), out var __jsonApplicationName) ? (string)__jsonApplicationName : (string)ApplicationName;} + {_subscriptionId = If( json?.PropertyT("SubscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_resourceGroup = If( json?.PropertyT("ResourceGroup"), out var __jsonResourceGroup) ? (string)__jsonResourceGroup : (string)ResourceGroup;} + {_destinationStorageSubscriptionId = If( json?.PropertyT("DestinationStorageSubscriptionId"), out var __jsonDestinationStorageSubscriptionId) ? (string)__jsonDestinationStorageSubscriptionId : (string)DestinationStorageSubscriptionId;} + {_destinationStorageLocationId = If( json?.PropertyT("DestinationStorageLocationId"), out var __jsonDestinationStorageLocationId) ? (string)__jsonDestinationStorageLocationId : (string)DestinationStorageLocationId;} + {_destinationAccountId = If( json?.PropertyT("DestinationAccountId"), out var __jsonDestinationAccountId) ? (string)__jsonDestinationAccountId : (string)DestinationAccountId;} + {_destinationType = If( json?.PropertyT("DestinationType"), out var __jsonDestinationType) ? (string)__jsonDestinationType : (string)DestinationType;} + {_isUserEnabled = If( json?.PropertyT("IsUserEnabled"), out var __jsonIsUserEnabled) ? (string)__jsonIsUserEnabled : (string)IsUserEnabled;} + {_lastUserUpdate = If( json?.PropertyT("LastUserUpdate"), out var __jsonLastUserUpdate) ? (string)__jsonLastUserUpdate : (string)LastUserUpdate;} + {_notificationQueueEnabled = If( json?.PropertyT("NotificationQueueEnabled"), out var __jsonNotificationQueueEnabled) ? (string)__jsonNotificationQueueEnabled : (string)NotificationQueueEnabled;} + {_exportStatus = If( json?.PropertyT("ExportStatus"), out var __jsonExportStatus) ? (string)__jsonExportStatus : (string)ExportStatus;} + {_lastSuccessTime = If( json?.PropertyT("LastSuccessTime"), out var __jsonLastSuccessTime) ? (string)__jsonLastSuccessTime : (string)LastSuccessTime;} + {_lastGapTime = If( json?.PropertyT("LastGapTime"), out var __jsonLastGapTime) ? (string)__jsonLastGapTime : (string)LastGapTime;} + {_permanentErrorReason = If( json?.PropertyT("PermanentErrorReason"), out var __jsonPermanentErrorReason) ? (string)__jsonPermanentErrorReason : (string)PermanentErrorReason;} + {_storageName = If( json?.PropertyT("StorageName"), out var __jsonStorageName) ? (string)__jsonStorageName : (string)StorageName;} + {_containerName = If( json?.PropertyT("ContainerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentExportConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._exportId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._exportId.ToString()) : null, "ExportId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._instrumentationKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._instrumentationKey.ToString()) : null, "InstrumentationKey" ,container.Add ); + } + AddIf( null != (((object)this._recordType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._recordType.ToString()) : null, "RecordTypes" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._applicationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._applicationName.ToString()) : null, "ApplicationName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "SubscriptionId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._resourceGroup.ToString()) : null, "ResourceGroup" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._destinationStorageSubscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._destinationStorageSubscriptionId.ToString()) : null, "DestinationStorageSubscriptionId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._destinationStorageLocationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._destinationStorageLocationId.ToString()) : null, "DestinationStorageLocationId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._destinationAccountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._destinationAccountId.ToString()) : null, "DestinationAccountId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._destinationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._destinationType.ToString()) : null, "DestinationType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._isUserEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._isUserEnabled.ToString()) : null, "IsUserEnabled" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lastUserUpdate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._lastUserUpdate.ToString()) : null, "LastUserUpdate" ,container.Add ); + } + AddIf( null != (((object)this._notificationQueueEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._notificationQueueEnabled.ToString()) : null, "NotificationQueueEnabled" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._exportStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._exportStatus.ToString()) : null, "ExportStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lastSuccessTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._lastSuccessTime.ToString()) : null, "LastSuccessTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lastGapTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._lastGapTime.ToString()) : null, "LastGapTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._permanentErrorReason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._permanentErrorReason.ToString()) : null, "PermanentErrorReason" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._storageName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._storageName.ToString()) : null, "StorageName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._containerName.ToString()) : null, "ContainerName" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.PowerShell.cs new file mode 100644 index 000000000000..ae570f64f18b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.PowerShell.cs @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// An Application Insights component Continuous Export configuration request definition. + /// + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentExportRequestTypeConverter))] + public partial class ApplicationInsightsComponentExportRequest + { + + /// + /// 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 ApplicationInsightsComponentExportRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecordType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).RecordType = (string) content.GetValueForProperty("RecordType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).RecordType, global::System.Convert.ToString); + } + if (content.Contains("DestinationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationType = (string) content.GetValueForProperty("DestinationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationType, global::System.Convert.ToString); + } + if (content.Contains("DestinationAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAddress = (string) content.GetValueForProperty("DestinationAddress",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAddress, global::System.Convert.ToString); + } + if (content.Contains("IsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).IsEnabled = (string) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).IsEnabled, global::System.Convert.ToString); + } + if (content.Contains("NotificationQueueEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueEnabled = (string) content.GetValueForProperty("NotificationQueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueEnabled, global::System.Convert.ToString); + } + if (content.Contains("NotificationQueueUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueUri = (string) content.GetValueForProperty("NotificationQueueUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueUri, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageSubscriptionId = (string) content.GetValueForProperty("DestinationStorageSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageLocationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageLocationId = (string) content.GetValueForProperty("DestinationStorageLocationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageLocationId, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId = (string) content.GetValueForProperty("DestinationAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId, 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 ApplicationInsightsComponentExportRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecordType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).RecordType = (string) content.GetValueForProperty("RecordType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).RecordType, global::System.Convert.ToString); + } + if (content.Contains("DestinationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationType = (string) content.GetValueForProperty("DestinationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationType, global::System.Convert.ToString); + } + if (content.Contains("DestinationAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAddress = (string) content.GetValueForProperty("DestinationAddress",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAddress, global::System.Convert.ToString); + } + if (content.Contains("IsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).IsEnabled = (string) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).IsEnabled, global::System.Convert.ToString); + } + if (content.Contains("NotificationQueueEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueEnabled = (string) content.GetValueForProperty("NotificationQueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueEnabled, global::System.Convert.ToString); + } + if (content.Contains("NotificationQueueUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueUri = (string) content.GetValueForProperty("NotificationQueueUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueUri, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageSubscriptionId = (string) content.GetValueForProperty("DestinationStorageSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageLocationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageLocationId = (string) content.GetValueForProperty("DestinationStorageLocationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageLocationId, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId = (string) content.GetValueForProperty("DestinationAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentExportRequest(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentExportRequest(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component Continuous Export configuration request definition. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentExportRequestTypeConverter))] + public partial interface IApplicationInsightsComponentExportRequest + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.TypeConverter.cs new file mode 100644 index 000000000000..7064ae27071b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentExportRequestTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentExportRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentExportRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentExportRequest.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.cs new file mode 100644 index 000000000000..a3f848d59a3f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// An Application Insights component Continuous Export configuration request definition. + /// + public partial class ApplicationInsightsComponentExportRequest : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal + { + + /// Backing field for property. + private string _destinationAccountId; + + /// The name of destination storage account. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string DestinationAccountId { get => this._destinationAccountId; set => this._destinationAccountId = value; } + + /// Backing field for property. + private string _destinationAddress; + + /// + /// The SAS URL for the destination storage container. It must grant write permission. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string DestinationAddress { get => this._destinationAddress; set => this._destinationAddress = value; } + + /// Backing field for property. + private string _destinationStorageLocationId; + + /// The location ID of the destination storage container. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string DestinationStorageLocationId { get => this._destinationStorageLocationId; set => this._destinationStorageLocationId = value; } + + /// Backing field for property. + private string _destinationStorageSubscriptionId; + + /// The subscription ID of the destination storage container. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string DestinationStorageSubscriptionId { get => this._destinationStorageSubscriptionId; set => this._destinationStorageSubscriptionId = value; } + + /// Backing field for property. + private string _destinationType; + + /// The Continuous Export destination type. This has to be 'Blob'. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string DestinationType { get => this._destinationType; set => this._destinationType = value; } + + /// Backing field for property. + private string _isEnabled; + + /// + /// Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string IsEnabled { get => this._isEnabled; set => this._isEnabled = value; } + + /// Backing field for property. + private string _notificationQueueEnabled; + + /// Deprecated + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string NotificationQueueEnabled { get => this._notificationQueueEnabled; set => this._notificationQueueEnabled = value; } + + /// Backing field for property. + private string _notificationQueueUri; + + /// Deprecated + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string NotificationQueueUri { get => this._notificationQueueUri; set => this._notificationQueueUri = value; } + + /// Backing field for property. + private string _recordType; + + /// + /// The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', + /// 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string RecordType { get => this._recordType; set => this._recordType = value; } + + /// + /// Creates an new instance. + /// + public ApplicationInsightsComponentExportRequest() + { + + } + } + /// An Application Insights component Continuous Export configuration request definition. + public partial interface IApplicationInsightsComponentExportRequest : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// The name of destination storage account. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of destination storage account.", + SerializedName = @"DestinationAccountId", + PossibleTypes = new [] { typeof(string) })] + string DestinationAccountId { get; set; } + /// + /// The SAS URL for the destination storage container. It must grant write permission. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS URL for the destination storage container. It must grant write permission.", + SerializedName = @"DestinationAddress", + PossibleTypes = new [] { typeof(string) })] + string DestinationAddress { get; set; } + /// The location ID of the destination storage container. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The location ID of the destination storage container.", + SerializedName = @"DestinationStorageLocationId", + PossibleTypes = new [] { typeof(string) })] + string DestinationStorageLocationId { get; set; } + /// The subscription ID of the destination storage container. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The subscription ID of the destination storage container.", + SerializedName = @"DestinationStorageSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + string DestinationStorageSubscriptionId { get; set; } + /// The Continuous Export destination type. This has to be 'Blob'. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Continuous Export destination type. This has to be 'Blob'.", + SerializedName = @"DestinationType", + PossibleTypes = new [] { typeof(string) })] + string DestinationType { get; set; } + /// + /// Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'.", + SerializedName = @"IsEnabled", + PossibleTypes = new [] { typeof(string) })] + string IsEnabled { get; set; } + /// Deprecated + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Deprecated", + SerializedName = @"NotificationQueueEnabled", + PossibleTypes = new [] { typeof(string) })] + string NotificationQueueEnabled { get; set; } + /// Deprecated + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Deprecated", + SerializedName = @"NotificationQueueUri", + PossibleTypes = new [] { typeof(string) })] + string NotificationQueueUri { get; set; } + /// + /// The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', + /// 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'.", + SerializedName = @"RecordTypes", + PossibleTypes = new [] { typeof(string) })] + string RecordType { get; set; } + + } + /// An Application Insights component Continuous Export configuration request definition. + internal partial interface IApplicationInsightsComponentExportRequestInternal + + { + /// The name of destination storage account. + string DestinationAccountId { get; set; } + /// + /// The SAS URL for the destination storage container. It must grant write permission. + /// + string DestinationAddress { get; set; } + /// The location ID of the destination storage container. + string DestinationStorageLocationId { get; set; } + /// The subscription ID of the destination storage container. + string DestinationStorageSubscriptionId { get; set; } + /// The Continuous Export destination type. This has to be 'Blob'. + string DestinationType { get; set; } + /// + /// Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. + /// + string IsEnabled { get; set; } + /// Deprecated + string NotificationQueueEnabled { get; set; } + /// Deprecated + string NotificationQueueUri { get; set; } + /// + /// The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', + /// 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + /// + string RecordType { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.json.cs new file mode 100644 index 000000000000..82409ef283b5 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// An Application Insights component Continuous Export configuration request definition. + /// + public partial class ApplicationInsightsComponentExportRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentExportRequest(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_recordType = If( json?.PropertyT("RecordTypes"), out var __jsonRecordTypes) ? (string)__jsonRecordTypes : (string)RecordType;} + {_destinationType = If( json?.PropertyT("DestinationType"), out var __jsonDestinationType) ? (string)__jsonDestinationType : (string)DestinationType;} + {_destinationAddress = If( json?.PropertyT("DestinationAddress"), out var __jsonDestinationAddress) ? (string)__jsonDestinationAddress : (string)DestinationAddress;} + {_isEnabled = If( json?.PropertyT("IsEnabled"), out var __jsonIsEnabled) ? (string)__jsonIsEnabled : (string)IsEnabled;} + {_notificationQueueEnabled = If( json?.PropertyT("NotificationQueueEnabled"), out var __jsonNotificationQueueEnabled) ? (string)__jsonNotificationQueueEnabled : (string)NotificationQueueEnabled;} + {_notificationQueueUri = If( json?.PropertyT("NotificationQueueUri"), out var __jsonNotificationQueueUri) ? (string)__jsonNotificationQueueUri : (string)NotificationQueueUri;} + {_destinationStorageSubscriptionId = If( json?.PropertyT("DestinationStorageSubscriptionId"), out var __jsonDestinationStorageSubscriptionId) ? (string)__jsonDestinationStorageSubscriptionId : (string)DestinationStorageSubscriptionId;} + {_destinationStorageLocationId = If( json?.PropertyT("DestinationStorageLocationId"), out var __jsonDestinationStorageLocationId) ? (string)__jsonDestinationStorageLocationId : (string)DestinationStorageLocationId;} + {_destinationAccountId = If( json?.PropertyT("DestinationAccountId"), out var __jsonDestinationAccountId) ? (string)__jsonDestinationAccountId : (string)DestinationAccountId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentExportRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._recordType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._recordType.ToString()) : null, "RecordTypes" ,container.Add ); + AddIf( null != (((object)this._destinationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._destinationType.ToString()) : null, "DestinationType" ,container.Add ); + AddIf( null != (((object)this._destinationAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._destinationAddress.ToString()) : null, "DestinationAddress" ,container.Add ); + AddIf( null != (((object)this._isEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._isEnabled.ToString()) : null, "IsEnabled" ,container.Add ); + AddIf( null != (((object)this._notificationQueueEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._notificationQueueEnabled.ToString()) : null, "NotificationQueueEnabled" ,container.Add ); + AddIf( null != (((object)this._notificationQueueUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._notificationQueueUri.ToString()) : null, "NotificationQueueUri" ,container.Add ); + AddIf( null != (((object)this._destinationStorageSubscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._destinationStorageSubscriptionId.ToString()) : null, "DestinationStorageSubscriptionId" ,container.Add ); + AddIf( null != (((object)this._destinationStorageLocationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._destinationStorageLocationId.ToString()) : null, "DestinationStorageLocationId" ,container.Add ); + AddIf( null != (((object)this._destinationAccountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._destinationAccountId.ToString()) : null, "DestinationAccountId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.PowerShell.cs new file mode 100644 index 000000000000..cc2065457a53 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.PowerShell.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component daily data volume cap status + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureTypeConverter))] + public partial class ApplicationInsightsComponentFeature + { + + /// + /// 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 ApplicationInsightsComponentFeature(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FeatureName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).FeatureName = (string) content.GetValueForProperty("FeatureName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).FeatureName, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("MeterRateFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterRateFrequency, global::System.Convert.ToString); + } + if (content.Contains("ResouceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).ResouceId = (string) content.GetValueForProperty("ResouceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).ResouceId, global::System.Convert.ToString); + } + if (content.Contains("IsHidden")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsHidden = (bool?) content.GetValueForProperty("IsHidden",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsHidden, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapabilityTypeConverter.ConvertFrom)); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("IsMainFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsMainFeature = (bool?) content.GetValueForProperty("IsMainFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsMainFeature, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SupportedAddonFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature = (string) content.GetValueForProperty("SupportedAddonFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature, 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 ApplicationInsightsComponentFeature(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FeatureName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).FeatureName = (string) content.GetValueForProperty("FeatureName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).FeatureName, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("MeterRateFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterRateFrequency, global::System.Convert.ToString); + } + if (content.Contains("ResouceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).ResouceId = (string) content.GetValueForProperty("ResouceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).ResouceId, global::System.Convert.ToString); + } + if (content.Contains("IsHidden")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsHidden = (bool?) content.GetValueForProperty("IsHidden",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsHidden, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapabilityTypeConverter.ConvertFrom)); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("IsMainFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsMainFeature = (bool?) content.GetValueForProperty("IsMainFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsMainFeature, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SupportedAddonFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature = (string) content.GetValueForProperty("SupportedAddonFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentFeature(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentFeature(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component daily data volume cap status + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureTypeConverter))] + public partial interface IApplicationInsightsComponentFeature + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.TypeConverter.cs new file mode 100644 index 000000000000..8158c81b4a5b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentFeatureTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentFeature.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentFeature.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentFeature.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.cs new file mode 100644 index 000000000000..e6259eb61e80 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component daily data volume cap status + public partial class ApplicationInsightsComponentFeature : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability[] _capability; + + /// A list of Application Insights component feature capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability[] Capability { get => this._capability; } + + /// Backing field for property. + private string _featureName; + + /// The pricing feature name. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string FeatureName { get => this._featureName; } + + /// Backing field for property. + private bool? _isHidden; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? IsHidden { get => this._isHidden; } + + /// Backing field for property. + private bool? _isMainFeature; + + /// Whether can apply addon feature on to it. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? IsMainFeature { get => this._isMainFeature; } + + /// Backing field for property. + private string _meterId; + + /// The meter id used for the feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string MeterId { get => this._meterId; } + + /// Backing field for property. + private string _meterRateFrequency; + + /// The meter rate for the feature's meter. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string MeterRateFrequency { get => this._meterRateFrequency; } + + /// Internal Acessors for Capability + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal.Capability { get => this._capability; set { {_capability = value;} } } + + /// Internal Acessors for FeatureName + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal.FeatureName { get => this._featureName; set { {_featureName = value;} } } + + /// Internal Acessors for IsHidden + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal.IsHidden { get => this._isHidden; set { {_isHidden = value;} } } + + /// Internal Acessors for IsMainFeature + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal.IsMainFeature { get => this._isMainFeature; set { {_isMainFeature = value;} } } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for MeterRateFrequency + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal.MeterRateFrequency { get => this._meterRateFrequency; set { {_meterRateFrequency = value;} } } + + /// Internal Acessors for ResouceId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal.ResouceId { get => this._resouceId; set { {_resouceId = value;} } } + + /// Internal Acessors for SupportedAddonFeature + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal.SupportedAddonFeature { get => this._supportedAddonFeature; set { {_supportedAddonFeature = value;} } } + + /// Internal Acessors for Title + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal.Title { get => this._title; set { {_title = value;} } } + + /// Backing field for property. + private string _resouceId; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ResouceId { get => this._resouceId; } + + /// Backing field for property. + private string _supportedAddonFeature; + + /// The add on features on main feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string SupportedAddonFeature { get => this._supportedAddonFeature; } + + /// Backing field for property. + private string _title; + + /// Display name of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Title { get => this._title; } + + /// Creates an new instance. + public ApplicationInsightsComponentFeature() + { + + } + } + /// An Application Insights component daily data volume cap status + public partial interface IApplicationInsightsComponentFeature : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// A list of Application Insights component feature capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A list of Application Insights component feature capability.", + SerializedName = @"Capabilities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability[] Capability { get; } + /// The pricing feature name. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The pricing feature name.", + SerializedName = @"FeatureName", + PossibleTypes = new [] { typeof(string) })] + string FeatureName { get; } + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"IsHidden", + PossibleTypes = new [] { typeof(bool) })] + bool? IsHidden { get; } + /// Whether can apply addon feature on to it. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether can apply addon feature on to it.", + SerializedName = @"IsMainFeature", + PossibleTypes = new [] { typeof(bool) })] + bool? IsMainFeature { get; } + /// The meter id used for the feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter id used for the feature.", + SerializedName = @"MeterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// The meter rate for the feature's meter. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter rate for the feature's meter.", + SerializedName = @"MeterRateFrequency", + PossibleTypes = new [] { typeof(string) })] + string MeterRateFrequency { get; } + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"ResouceId", + PossibleTypes = new [] { typeof(string) })] + string ResouceId { get; } + /// The add on features on main feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The add on features on main feature.", + SerializedName = @"SupportedAddonFeatures", + PossibleTypes = new [] { typeof(string) })] + string SupportedAddonFeature { get; } + /// Display name of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Display name of the feature.", + SerializedName = @"Title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; } + + } + /// An Application Insights component daily data volume cap status + internal partial interface IApplicationInsightsComponentFeatureInternal + + { + /// A list of Application Insights component feature capability. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability[] Capability { get; set; } + /// The pricing feature name. + string FeatureName { get; set; } + /// Reserved, not used now. + bool? IsHidden { get; set; } + /// Whether can apply addon feature on to it. + bool? IsMainFeature { get; set; } + /// The meter id used for the feature. + string MeterId { get; set; } + /// The meter rate for the feature's meter. + string MeterRateFrequency { get; set; } + /// Reserved, not used now. + string ResouceId { get; set; } + /// The add on features on main feature. + string SupportedAddonFeature { get; set; } + /// Display name of the feature. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.json.cs new file mode 100644 index 000000000000..38dba7d8cb37 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.json.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component daily data volume cap status + public partial class ApplicationInsightsComponentFeature + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentFeature(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_featureName = If( json?.PropertyT("FeatureName"), out var __jsonFeatureName) ? (string)__jsonFeatureName : (string)FeatureName;} + {_meterId = If( json?.PropertyT("MeterId"), out var __jsonMeterId) ? (string)__jsonMeterId : (string)MeterId;} + {_meterRateFrequency = If( json?.PropertyT("MeterRateFrequency"), out var __jsonMeterRateFrequency) ? (string)__jsonMeterRateFrequency : (string)MeterRateFrequency;} + {_resouceId = If( json?.PropertyT("ResouceId"), out var __jsonResouceId) ? (string)__jsonResouceId : (string)ResouceId;} + {_isHidden = If( json?.PropertyT("IsHidden"), out var __jsonIsHidden) ? (bool?)__jsonIsHidden : IsHidden;} + {_capability = If( json?.PropertyT("Capabilities"), out var __jsonCapabilities) ? If( __jsonCapabilities as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapability.FromJson(__u) )) ))() : null : Capability;} + {_title = If( json?.PropertyT("Title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_isMainFeature = If( json?.PropertyT("IsMainFeature"), out var __jsonIsMainFeature) ? (bool?)__jsonIsMainFeature : IsMainFeature;} + {_supportedAddonFeature = If( json?.PropertyT("SupportedAddonFeatures"), out var __jsonSupportedAddonFeatures) ? (string)__jsonSupportedAddonFeatures : (string)SupportedAddonFeature;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentFeature(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._featureName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._featureName.ToString()) : null, "FeatureName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._meterId.ToString()) : null, "MeterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterRateFrequency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._meterRateFrequency.ToString()) : null, "MeterRateFrequency" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resouceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._resouceId.ToString()) : null, "ResouceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isHidden ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._isHidden) : null, "IsHidden" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._capability) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __x in this._capability ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("Capabilities",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._title.ToString()) : null, "Title" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isMainFeature ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._isMainFeature) : null, "IsMainFeature" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._supportedAddonFeature)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._supportedAddonFeature.ToString()) : null, "SupportedAddonFeatures" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.PowerShell.cs new file mode 100644 index 000000000000..9d3731382881 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.PowerShell.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component feature capabilities + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureCapabilitiesTypeConverter))] + public partial class ApplicationInsightsComponentFeatureCapabilities + { + + /// + /// 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 ApplicationInsightsComponentFeatureCapabilities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SupportExportData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).SupportExportData = (bool?) content.GetValueForProperty("SupportExportData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).SupportExportData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BurstThrottlePolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).BurstThrottlePolicy = (string) content.GetValueForProperty("BurstThrottlePolicy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).BurstThrottlePolicy, global::System.Convert.ToString); + } + if (content.Contains("MetadataClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MetadataClass = (string) content.GetValueForProperty("MetadataClass",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MetadataClass, global::System.Convert.ToString); + } + if (content.Contains("LiveStreamMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).LiveStreamMetric = (bool?) content.GetValueForProperty("LiveStreamMetric",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).LiveStreamMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApplicationMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApplicationMap = (bool?) content.GetValueForProperty("ApplicationMap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApplicationMap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WorkItemIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).WorkItemIntegration = (bool?) content.GetValueForProperty("WorkItemIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).WorkItemIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PowerBiIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).PowerBiIntegration = (bool?) content.GetValueForProperty("PowerBiIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).PowerBiIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).OpenSchema = (bool?) content.GetValueForProperty("OpenSchema",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).OpenSchema, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProactiveDetection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ProactiveDetection = (bool?) content.GetValueForProperty("ProactiveDetection",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ProactiveDetection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AnalyticsIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).AnalyticsIntegration = (bool?) content.GetValueForProperty("AnalyticsIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).AnalyticsIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MultipleStepWebTest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MultipleStepWebTest = (bool?) content.GetValueForProperty("MultipleStepWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MultipleStepWebTest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiAccessLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApiAccessLevel = (string) content.GetValueForProperty("ApiAccessLevel",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApiAccessLevel, global::System.Convert.ToString); + } + if (content.Contains("TrackingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).TrackingType = (string) content.GetValueForProperty("TrackingType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).TrackingType, global::System.Convert.ToString); + } + if (content.Contains("DailyCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCap = (float?) content.GetValueForProperty("DailyCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DailyCapResetTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCapResetTime = (float?) content.GetValueForProperty("DailyCapResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCapResetTime, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ThrottleRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ThrottleRate = (float?) content.GetValueForProperty("ThrottleRate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ThrottleRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentFeatureCapabilities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SupportExportData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).SupportExportData = (bool?) content.GetValueForProperty("SupportExportData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).SupportExportData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BurstThrottlePolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).BurstThrottlePolicy = (string) content.GetValueForProperty("BurstThrottlePolicy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).BurstThrottlePolicy, global::System.Convert.ToString); + } + if (content.Contains("MetadataClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MetadataClass = (string) content.GetValueForProperty("MetadataClass",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MetadataClass, global::System.Convert.ToString); + } + if (content.Contains("LiveStreamMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).LiveStreamMetric = (bool?) content.GetValueForProperty("LiveStreamMetric",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).LiveStreamMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApplicationMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApplicationMap = (bool?) content.GetValueForProperty("ApplicationMap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApplicationMap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WorkItemIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).WorkItemIntegration = (bool?) content.GetValueForProperty("WorkItemIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).WorkItemIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PowerBiIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).PowerBiIntegration = (bool?) content.GetValueForProperty("PowerBiIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).PowerBiIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).OpenSchema = (bool?) content.GetValueForProperty("OpenSchema",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).OpenSchema, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProactiveDetection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ProactiveDetection = (bool?) content.GetValueForProperty("ProactiveDetection",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ProactiveDetection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AnalyticsIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).AnalyticsIntegration = (bool?) content.GetValueForProperty("AnalyticsIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).AnalyticsIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MultipleStepWebTest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MultipleStepWebTest = (bool?) content.GetValueForProperty("MultipleStepWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MultipleStepWebTest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiAccessLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApiAccessLevel = (string) content.GetValueForProperty("ApiAccessLevel",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApiAccessLevel, global::System.Convert.ToString); + } + if (content.Contains("TrackingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).TrackingType = (string) content.GetValueForProperty("TrackingType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).TrackingType, global::System.Convert.ToString); + } + if (content.Contains("DailyCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCap = (float?) content.GetValueForProperty("DailyCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DailyCapResetTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCapResetTime = (float?) content.GetValueForProperty("DailyCapResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCapResetTime, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ThrottleRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ThrottleRate = (float?) content.GetValueForProperty("ThrottleRate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ThrottleRate, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentFeatureCapabilities(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentFeatureCapabilities(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component feature capabilities + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureCapabilitiesTypeConverter))] + public partial interface IApplicationInsightsComponentFeatureCapabilities + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.TypeConverter.cs new file mode 100644 index 000000000000..6424b72f9d1f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.TypeConverter.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentFeatureCapabilitiesTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentFeatureCapabilities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentFeatureCapabilities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentFeatureCapabilities.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.cs new file mode 100644 index 000000000000..89c1409d157b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.cs @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component feature capabilities + public partial class ApplicationInsightsComponentFeatureCapabilities : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal + { + + /// Backing field for property. + private bool? _analyticsIntegration; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? AnalyticsIntegration { get => this._analyticsIntegration; } + + /// Backing field for property. + private string _apiAccessLevel; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ApiAccessLevel { get => this._apiAccessLevel; } + + /// Backing field for property. + private bool? _applicationMap; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? ApplicationMap { get => this._applicationMap; } + + /// Backing field for property. + private string _burstThrottlePolicy; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string BurstThrottlePolicy { get => this._burstThrottlePolicy; } + + /// Backing field for property. + private float? _dailyCap; + + /// Daily data volume cap in GB. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public float? DailyCap { get => this._dailyCap; } + + /// Backing field for property. + private float? _dailyCapResetTime; + + /// Daily data volume cap UTC reset hour. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public float? DailyCapResetTime { get => this._dailyCapResetTime; } + + /// Backing field for property. + private bool? _liveStreamMetric; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? LiveStreamMetric { get => this._liveStreamMetric; } + + /// Backing field for property. + private string _metadataClass; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string MetadataClass { get => this._metadataClass; } + + /// Internal Acessors for AnalyticsIntegration + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.AnalyticsIntegration { get => this._analyticsIntegration; set { {_analyticsIntegration = value;} } } + + /// Internal Acessors for ApiAccessLevel + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.ApiAccessLevel { get => this._apiAccessLevel; set { {_apiAccessLevel = value;} } } + + /// Internal Acessors for ApplicationMap + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.ApplicationMap { get => this._applicationMap; set { {_applicationMap = value;} } } + + /// Internal Acessors for BurstThrottlePolicy + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.BurstThrottlePolicy { get => this._burstThrottlePolicy; set { {_burstThrottlePolicy = value;} } } + + /// Internal Acessors for DailyCap + float? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.DailyCap { get => this._dailyCap; set { {_dailyCap = value;} } } + + /// Internal Acessors for DailyCapResetTime + float? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.DailyCapResetTime { get => this._dailyCapResetTime; set { {_dailyCapResetTime = value;} } } + + /// Internal Acessors for LiveStreamMetric + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.LiveStreamMetric { get => this._liveStreamMetric; set { {_liveStreamMetric = value;} } } + + /// Internal Acessors for MetadataClass + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.MetadataClass { get => this._metadataClass; set { {_metadataClass = value;} } } + + /// Internal Acessors for MultipleStepWebTest + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.MultipleStepWebTest { get => this._multipleStepWebTest; set { {_multipleStepWebTest = value;} } } + + /// Internal Acessors for OpenSchema + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.OpenSchema { get => this._openSchema; set { {_openSchema = value;} } } + + /// Internal Acessors for PowerBiIntegration + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.PowerBiIntegration { get => this._powerBiIntegration; set { {_powerBiIntegration = value;} } } + + /// Internal Acessors for ProactiveDetection + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.ProactiveDetection { get => this._proactiveDetection; set { {_proactiveDetection = value;} } } + + /// Internal Acessors for SupportExportData + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.SupportExportData { get => this._supportExportData; set { {_supportExportData = value;} } } + + /// Internal Acessors for ThrottleRate + float? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.ThrottleRate { get => this._throttleRate; set { {_throttleRate = value;} } } + + /// Internal Acessors for TrackingType + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.TrackingType { get => this._trackingType; set { {_trackingType = value;} } } + + /// Internal Acessors for WorkItemIntegration + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilitiesInternal.WorkItemIntegration { get => this._workItemIntegration; set { {_workItemIntegration = value;} } } + + /// Backing field for property. + private bool? _multipleStepWebTest; + + /// Whether allow to use multiple steps web test feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? MultipleStepWebTest { get => this._multipleStepWebTest; } + + /// Backing field for property. + private bool? _openSchema; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? OpenSchema { get => this._openSchema; } + + /// Backing field for property. + private bool? _powerBiIntegration; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? PowerBiIntegration { get => this._powerBiIntegration; } + + /// Backing field for property. + private bool? _proactiveDetection; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? ProactiveDetection { get => this._proactiveDetection; } + + /// Backing field for property. + private bool? _supportExportData; + + /// Whether allow to use continuous export feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? SupportExportData { get => this._supportExportData; } + + /// Backing field for property. + private float? _throttleRate; + + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public float? ThrottleRate { get => this._throttleRate; } + + /// Backing field for property. + private string _trackingType; + + /// The application insights component used tracking type. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string TrackingType { get => this._trackingType; } + + /// Backing field for property. + private bool? _workItemIntegration; + + /// Whether allow to use work item integration feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? WorkItemIntegration { get => this._workItemIntegration; } + + /// + /// Creates an new instance. + /// + public ApplicationInsightsComponentFeatureCapabilities() + { + + } + } + /// An Application Insights component feature capabilities + public partial interface IApplicationInsightsComponentFeatureCapabilities : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"AnalyticsIntegration", + PossibleTypes = new [] { typeof(bool) })] + bool? AnalyticsIntegration { get; } + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"ApiAccessLevel", + PossibleTypes = new [] { typeof(string) })] + string ApiAccessLevel { get; } + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"ApplicationMap", + PossibleTypes = new [] { typeof(bool) })] + bool? ApplicationMap { get; } + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"BurstThrottlePolicy", + PossibleTypes = new [] { typeof(string) })] + string BurstThrottlePolicy { get; } + /// Daily data volume cap in GB. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Daily data volume cap in GB.", + SerializedName = @"DailyCap", + PossibleTypes = new [] { typeof(float) })] + float? DailyCap { get; } + /// Daily data volume cap UTC reset hour. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Daily data volume cap UTC reset hour.", + SerializedName = @"DailyCapResetTime", + PossibleTypes = new [] { typeof(float) })] + float? DailyCapResetTime { get; } + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"LiveStreamMetrics", + PossibleTypes = new [] { typeof(bool) })] + bool? LiveStreamMetric { get; } + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"MetadataClass", + PossibleTypes = new [] { typeof(string) })] + string MetadataClass { get; } + /// Whether allow to use multiple steps web test feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether allow to use multiple steps web test feature.", + SerializedName = @"MultipleStepWebTest", + PossibleTypes = new [] { typeof(bool) })] + bool? MultipleStepWebTest { get; } + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"OpenSchema", + PossibleTypes = new [] { typeof(bool) })] + bool? OpenSchema { get; } + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"PowerBIIntegration", + PossibleTypes = new [] { typeof(bool) })] + bool? PowerBiIntegration { get; } + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"ProactiveDetection", + PossibleTypes = new [] { typeof(bool) })] + bool? ProactiveDetection { get; } + /// Whether allow to use continuous export feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether allow to use continuous export feature.", + SerializedName = @"SupportExportData", + PossibleTypes = new [] { typeof(bool) })] + bool? SupportExportData { get; } + /// Reserved, not used now. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Reserved, not used now.", + SerializedName = @"ThrottleRate", + PossibleTypes = new [] { typeof(float) })] + float? ThrottleRate { get; } + /// The application insights component used tracking type. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The application insights component used tracking type.", + SerializedName = @"TrackingType", + PossibleTypes = new [] { typeof(string) })] + string TrackingType { get; } + /// Whether allow to use work item integration feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether allow to use work item integration feature.", + SerializedName = @"WorkItemIntegration", + PossibleTypes = new [] { typeof(bool) })] + bool? WorkItemIntegration { get; } + + } + /// An Application Insights component feature capabilities + internal partial interface IApplicationInsightsComponentFeatureCapabilitiesInternal + + { + /// Reserved, not used now. + bool? AnalyticsIntegration { get; set; } + /// Reserved, not used now. + string ApiAccessLevel { get; set; } + /// Reserved, not used now. + bool? ApplicationMap { get; set; } + /// Reserved, not used now. + string BurstThrottlePolicy { get; set; } + /// Daily data volume cap in GB. + float? DailyCap { get; set; } + /// Daily data volume cap UTC reset hour. + float? DailyCapResetTime { get; set; } + /// Reserved, not used now. + bool? LiveStreamMetric { get; set; } + /// Reserved, not used now. + string MetadataClass { get; set; } + /// Whether allow to use multiple steps web test feature. + bool? MultipleStepWebTest { get; set; } + /// Reserved, not used now. + bool? OpenSchema { get; set; } + /// Reserved, not used now. + bool? PowerBiIntegration { get; set; } + /// Reserved, not used now. + bool? ProactiveDetection { get; set; } + /// Whether allow to use continuous export feature. + bool? SupportExportData { get; set; } + /// Reserved, not used now. + float? ThrottleRate { get; set; } + /// The application insights component used tracking type. + string TrackingType { get; set; } + /// Whether allow to use work item integration feature. + bool? WorkItemIntegration { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.json.cs new file mode 100644 index 000000000000..9711ca22635d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.json.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component feature capabilities + public partial class ApplicationInsightsComponentFeatureCapabilities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentFeatureCapabilities(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_supportExportData = If( json?.PropertyT("SupportExportData"), out var __jsonSupportExportData) ? (bool?)__jsonSupportExportData : SupportExportData;} + {_burstThrottlePolicy = If( json?.PropertyT("BurstThrottlePolicy"), out var __jsonBurstThrottlePolicy) ? (string)__jsonBurstThrottlePolicy : (string)BurstThrottlePolicy;} + {_metadataClass = If( json?.PropertyT("MetadataClass"), out var __jsonMetadataClass) ? (string)__jsonMetadataClass : (string)MetadataClass;} + {_liveStreamMetric = If( json?.PropertyT("LiveStreamMetrics"), out var __jsonLiveStreamMetrics) ? (bool?)__jsonLiveStreamMetrics : LiveStreamMetric;} + {_applicationMap = If( json?.PropertyT("ApplicationMap"), out var __jsonApplicationMap) ? (bool?)__jsonApplicationMap : ApplicationMap;} + {_workItemIntegration = If( json?.PropertyT("WorkItemIntegration"), out var __jsonWorkItemIntegration) ? (bool?)__jsonWorkItemIntegration : WorkItemIntegration;} + {_powerBiIntegration = If( json?.PropertyT("PowerBIIntegration"), out var __jsonPowerBiIntegration) ? (bool?)__jsonPowerBiIntegration : PowerBiIntegration;} + {_openSchema = If( json?.PropertyT("OpenSchema"), out var __jsonOpenSchema) ? (bool?)__jsonOpenSchema : OpenSchema;} + {_proactiveDetection = If( json?.PropertyT("ProactiveDetection"), out var __jsonProactiveDetection) ? (bool?)__jsonProactiveDetection : ProactiveDetection;} + {_analyticsIntegration = If( json?.PropertyT("AnalyticsIntegration"), out var __jsonAnalyticsIntegration) ? (bool?)__jsonAnalyticsIntegration : AnalyticsIntegration;} + {_multipleStepWebTest = If( json?.PropertyT("MultipleStepWebTest"), out var __jsonMultipleStepWebTest) ? (bool?)__jsonMultipleStepWebTest : MultipleStepWebTest;} + {_apiAccessLevel = If( json?.PropertyT("ApiAccessLevel"), out var __jsonApiAccessLevel) ? (string)__jsonApiAccessLevel : (string)ApiAccessLevel;} + {_trackingType = If( json?.PropertyT("TrackingType"), out var __jsonTrackingType) ? (string)__jsonTrackingType : (string)TrackingType;} + {_dailyCap = If( json?.PropertyT("DailyCap"), out var __jsonDailyCap) ? (float?)__jsonDailyCap : DailyCap;} + {_dailyCapResetTime = If( json?.PropertyT("DailyCapResetTime"), out var __jsonDailyCapResetTime) ? (float?)__jsonDailyCapResetTime : DailyCapResetTime;} + {_throttleRate = If( json?.PropertyT("ThrottleRate"), out var __jsonThrottleRate) ? (float?)__jsonThrottleRate : ThrottleRate;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentFeatureCapabilities(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._supportExportData ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._supportExportData) : null, "SupportExportData" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._burstThrottlePolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._burstThrottlePolicy.ToString()) : null, "BurstThrottlePolicy" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._metadataClass)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._metadataClass.ToString()) : null, "MetadataClass" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._liveStreamMetric ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._liveStreamMetric) : null, "LiveStreamMetrics" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._applicationMap ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._applicationMap) : null, "ApplicationMap" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._workItemIntegration ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._workItemIntegration) : null, "WorkItemIntegration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._powerBiIntegration ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._powerBiIntegration) : null, "PowerBIIntegration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._openSchema ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._openSchema) : null, "OpenSchema" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._proactiveDetection ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._proactiveDetection) : null, "ProactiveDetection" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._analyticsIntegration ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._analyticsIntegration) : null, "AnalyticsIntegration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._multipleStepWebTest ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._multipleStepWebTest) : null, "MultipleStepWebTest" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._apiAccessLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._apiAccessLevel.ToString()) : null, "ApiAccessLevel" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._trackingType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._trackingType.ToString()) : null, "TrackingType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._dailyCap ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNumber((float)this._dailyCap) : null, "DailyCap" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._dailyCapResetTime ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNumber((float)this._dailyCapResetTime) : null, "DailyCapResetTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._throttleRate ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNumber((float)this._throttleRate) : null, "ThrottleRate" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.PowerShell.cs new file mode 100644 index 000000000000..b6f754bdbc62 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.PowerShell.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component feature capability + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureCapabilityTypeConverter))] + public partial class ApplicationInsightsComponentFeatureCapability + { + + /// + /// 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 ApplicationInsightsComponentFeatureCapability(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("MeterRateFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency, 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 ApplicationInsightsComponentFeatureCapability(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("MeterRateFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentFeatureCapability(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentFeatureCapability(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component feature capability + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureCapabilityTypeConverter))] + public partial interface IApplicationInsightsComponentFeatureCapability + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.TypeConverter.cs new file mode 100644 index 000000000000..7fcd695f5951 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentFeatureCapabilityTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentFeatureCapability.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentFeatureCapability.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentFeatureCapability.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.cs new file mode 100644 index 000000000000..3a013f5bc74e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.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.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component feature capability + public partial class ApplicationInsightsComponentFeatureCapability : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal + { + + /// Backing field for property. + private string _description; + + /// The description of the capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Backing field for property. + private string _meterId; + + /// The meter used for the capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string MeterId { get => this._meterId; } + + /// Backing field for property. + private string _meterRateFrequency; + + /// The meter rate of the meter. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string MeterRateFrequency { get => this._meterRateFrequency; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for MeterRateFrequency + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal.MeterRateFrequency { get => this._meterRateFrequency; set { {_meterRateFrequency = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Unit + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal.Unit { get => this._unit; set { {_unit = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _unit; + + /// The unit of the capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Unit { get => this._unit; } + + /// Backing field for property. + private string _value; + + /// The value of the capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Value { get => this._value; } + + /// + /// Creates an new instance. + /// + public ApplicationInsightsComponentFeatureCapability() + { + + } + } + /// An Application Insights component feature capability + public partial interface IApplicationInsightsComponentFeatureCapability : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// The description of the capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The description of the capability.", + SerializedName = @"Description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// The meter used for the capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter used for the capability.", + SerializedName = @"MeterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// The meter rate of the meter. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The meter rate of the meter.", + SerializedName = @"MeterRateFrequency", + PossibleTypes = new [] { typeof(string) })] + string MeterRateFrequency { get; } + /// The name of the capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the capability.", + SerializedName = @"Name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The unit of the capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unit of the capability.", + SerializedName = @"Unit", + PossibleTypes = new [] { typeof(string) })] + string Unit { get; } + /// The value of the capability. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The value of the capability.", + SerializedName = @"Value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; } + + } + /// An Application Insights component feature capability + internal partial interface IApplicationInsightsComponentFeatureCapabilityInternal + + { + /// The description of the capability. + string Description { get; set; } + /// The meter used for the capability. + string MeterId { get; set; } + /// The meter rate of the meter. + string MeterRateFrequency { get; set; } + /// The name of the capability. + string Name { get; set; } + /// The unit of the capability. + string Unit { get; set; } + /// The value of the capability. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.json.cs new file mode 100644 index 000000000000..d8d42537f849 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.json.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component feature capability + public partial class ApplicationInsightsComponentFeatureCapability + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentFeatureCapability(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("Name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_description = If( json?.PropertyT("Description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_value = If( json?.PropertyT("Value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_unit = If( json?.PropertyT("Unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} + {_meterId = If( json?.PropertyT("MeterId"), out var __jsonMeterId) ? (string)__jsonMeterId : (string)MeterId;} + {_meterRateFrequency = If( json?.PropertyT("MeterRateFrequency"), out var __jsonMeterRateFrequency) ? (string)__jsonMeterRateFrequency : (string)MeterRateFrequency;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentFeatureCapability(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._name.ToString()) : null, "Name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._description.ToString()) : null, "Description" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._value.ToString()) : null, "Value" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._unit.ToString()) : null, "Unit" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._meterId.ToString()) : null, "MeterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterRateFrequency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._meterRateFrequency.ToString()) : null, "MeterRateFrequency" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.PowerShell.cs new file mode 100644 index 000000000000..1dea9532fcd4 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.PowerShell.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component daily data volume cap status + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentQuotaStatusTypeConverter))] + public partial class ApplicationInsightsComponentQuotaStatus + { + + /// + /// 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 ApplicationInsightsComponentQuotaStatus(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).AppId, global::System.Convert.ToString); + } + if (content.Contains("ShouldBeThrottled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ShouldBeThrottled = (bool?) content.GetValueForProperty("ShouldBeThrottled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ShouldBeThrottled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExpirationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime = (string) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime, 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 ApplicationInsightsComponentQuotaStatus(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).AppId, global::System.Convert.ToString); + } + if (content.Contains("ShouldBeThrottled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ShouldBeThrottled = (bool?) content.GetValueForProperty("ShouldBeThrottled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ShouldBeThrottled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ExpirationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime = (string) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentQuotaStatus(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentQuotaStatus(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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component daily data volume cap status + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentQuotaStatusTypeConverter))] + public partial interface IApplicationInsightsComponentQuotaStatus + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.TypeConverter.cs new file mode 100644 index 000000000000..457270dd3d5f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentQuotaStatusTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentQuotaStatus.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentQuotaStatus.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentQuotaStatus.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.cs new file mode 100644 index 000000000000..eb2150cf43f5 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.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.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component daily data volume cap status + public partial class ApplicationInsightsComponentQuotaStatus : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal + { + + /// Backing field for property. + private string _appId; + + /// The Application ID for the Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string AppId { get => this._appId; } + + /// Backing field for property. + private string _expirationTime; + + /// + /// Date and time when the daily data volume cap will be reset, and data ingestion will resume. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ExpirationTime { get => this._expirationTime; } + + /// Internal Acessors for AppId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal.AppId { get => this._appId; set { {_appId = value;} } } + + /// Internal Acessors for ExpirationTime + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal.ExpirationTime { get => this._expirationTime; set { {_expirationTime = value;} } } + + /// Internal Acessors for ShouldBeThrottled + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal.ShouldBeThrottled { get => this._shouldBeThrottled; set { {_shouldBeThrottled = value;} } } + + /// Backing field for property. + private bool? _shouldBeThrottled; + + /// The daily data volume cap is met, and data ingestion will be stopped. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? ShouldBeThrottled { get => this._shouldBeThrottled; } + + /// Creates an new instance. + public ApplicationInsightsComponentQuotaStatus() + { + + } + } + /// An Application Insights component daily data volume cap status + public partial interface IApplicationInsightsComponentQuotaStatus : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// The Application ID for the Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Application ID for the Application Insights component.", + SerializedName = @"AppId", + PossibleTypes = new [] { typeof(string) })] + string AppId { get; } + /// + /// Date and time when the daily data volume cap will be reset, and data ingestion will resume. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date and time when the daily data volume cap will be reset, and data ingestion will resume.", + SerializedName = @"ExpirationTime", + PossibleTypes = new [] { typeof(string) })] + string ExpirationTime { get; } + /// The daily data volume cap is met, and data ingestion will be stopped. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The daily data volume cap is met, and data ingestion will be stopped.", + SerializedName = @"ShouldBeThrottled", + PossibleTypes = new [] { typeof(bool) })] + bool? ShouldBeThrottled { get; } + + } + /// An Application Insights component daily data volume cap status + internal partial interface IApplicationInsightsComponentQuotaStatusInternal + + { + /// The Application ID for the Application Insights component. + string AppId { get; set; } + /// + /// Date and time when the daily data volume cap will be reset, and data ingestion will resume. + /// + string ExpirationTime { get; set; } + /// The daily data volume cap is met, and data ingestion will be stopped. + bool? ShouldBeThrottled { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.json.cs new file mode 100644 index 000000000000..46dc2b6e8ba2 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component daily data volume cap status + public partial class ApplicationInsightsComponentQuotaStatus + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentQuotaStatus(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_appId = If( json?.PropertyT("AppId"), out var __jsonAppId) ? (string)__jsonAppId : (string)AppId;} + {_shouldBeThrottled = If( json?.PropertyT("ShouldBeThrottled"), out var __jsonShouldBeThrottled) ? (bool?)__jsonShouldBeThrottled : ShouldBeThrottled;} + {_expirationTime = If( json?.PropertyT("ExpirationTime"), out var __jsonExpirationTime) ? (string)__jsonExpirationTime : (string)ExpirationTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentQuotaStatus(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._appId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._appId.ToString()) : null, "AppId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._shouldBeThrottled ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._shouldBeThrottled) : null, "ShouldBeThrottled" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._expirationTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._expirationTime.ToString()) : null, "ExpirationTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..4e67282f2e06 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + [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.ApplicationInsights.Models.Api20150501.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.ApplicationInsights.Models.Api20150501.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("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponseInternal)this).Message, 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 ErrorResponse(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.ApplicationInsights.Models.Api20150501.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api20150501.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] + public partial interface IErrorResponse + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..978c110476ae --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IErrorResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.cs new file mode 100644 index 000000000000..dc710a7ee953 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + public partial class ErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponseInternal + { + + /// Backing field for property. + private string _code; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private string _message; + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Creates an new instance. + public ErrorResponse() + { + + } + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + public partial interface IErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + internal partial interface IErrorResponseInternal + + { + /// Error code. + string Code { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.json.cs new file mode 100644 index 000000000000..b16f3a2779ff --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ErrorResponse.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + 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.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.PowerShell.cs new file mode 100644 index 000000000000..a0d75950d64a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Inner error + [System.ComponentModel.TypeConverter(typeof(InnerErrorTypeConverter))] + public partial class InnerError + { + + /// + /// 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.ApplicationInsights.Models.Api20150501.IInnerError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new InnerError(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.ApplicationInsights.Models.Api20150501.IInnerError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new InnerError(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.ApplicationInsights.Models.Api20150501.IInnerError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal InnerError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Diagnosticcontext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)this).Diagnosticcontext = (string) content.GetValueForProperty("Diagnosticcontext",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)this).Diagnosticcontext, global::System.Convert.ToString); + } + if (content.Contains("Time")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)this).Time = (global::System.DateTime?) content.GetValueForProperty("Time",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)this).Time, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal InnerError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Diagnosticcontext")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)this).Diagnosticcontext = (string) content.GetValueForProperty("Diagnosticcontext",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)this).Diagnosticcontext, global::System.Convert.ToString); + } + if (content.Contains("Time")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)this).Time = (global::System.DateTime?) content.GetValueForProperty("Time",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal)this).Time, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + 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.ApplicationInsights.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(); + } + } + /// Inner error + [System.ComponentModel.TypeConverter(typeof(InnerErrorTypeConverter))] + public partial interface IInnerError + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.TypeConverter.cs new file mode 100644 index 000000000000..3aa18befba08 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class InnerErrorTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IInnerError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return InnerError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return InnerError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return InnerError.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.cs new file mode 100644 index 000000000000..139c4abb2f66 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Inner error + public partial class InnerError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerErrorInternal + { + + /// Backing field for property. + private string _diagnosticcontext; + + /// Provides correlation for request + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Diagnosticcontext { get => this._diagnosticcontext; set => this._diagnosticcontext = value; } + + /// Backing field for property. + private global::System.DateTime? _time; + + /// Request time + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public global::System.DateTime? Time { get => this._time; set => this._time = value; } + + /// Creates an new instance. + public InnerError() + { + + } + } + /// Inner error + public partial interface IInnerError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Provides correlation for request + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provides correlation for request", + SerializedName = @"diagnosticcontext", + PossibleTypes = new [] { typeof(string) })] + string Diagnosticcontext { get; set; } + /// Request time + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Request time", + SerializedName = @"time", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Time { get; set; } + + } + /// Inner error + internal partial interface IInnerErrorInternal + + { + /// Provides correlation for request + string Diagnosticcontext { get; set; } + /// Request time + global::System.DateTime? Time { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.json.cs new file mode 100644 index 000000000000..e2f49ad6f150 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.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.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Inner error + public partial class InnerError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new InnerError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal InnerError(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_diagnosticcontext = If( json?.PropertyT("diagnosticcontext"), out var __jsonDiagnosticcontext) ? (string)__jsonDiagnosticcontext : (string)Diagnosticcontext;} + {_time = If( json?.PropertyT("time"), out var __jsonTime) ? global::System.DateTime.TryParse((string)__jsonTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimeValue) ? __jsonTimeValue : Time : Time;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._diagnosticcontext)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._diagnosticcontext.ToString()) : null, "diagnosticcontext" ,container.Add ); + AddIf( null != this._time ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._time?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "time" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..369dfcb11c25 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// CDN REST API operation + [System.ComponentModel.TypeConverter(typeof(OperationAutoGeneratedTypeConverter))] + public partial class OperationAutoGenerated + { + + /// + /// 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.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationAutoGenerated(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.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationAutoGenerated(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.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationAutoGenerated(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayOperation, 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 OperationAutoGenerated(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal)this).DisplayOperation, 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.ApplicationInsights.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(); + } + } + /// CDN REST API operation + [System.ComponentModel.TypeConverter(typeof(OperationAutoGeneratedTypeConverter))] + public partial interface IOperationAutoGenerated + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..75ba1012afe5 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationAutoGeneratedTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationAutoGenerated.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationAutoGenerated.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.cs new file mode 100644 index 000000000000..42d93dd8ad6e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// CDN REST API operation + public partial class OperationAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplay _display; + + /// The object that represents the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationDisplay()); set => this._display = value; } + + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)Display).Operation = value ?? null; } + + /// Service provider: Microsoft.Cdn + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)Display).Provider = value ?? null; } + + /// Resource on which the operation is performed: Profile, endpoint, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)Display).Resource = value ?? null; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGeneratedInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationDisplay()); set { {_display = value;} } } + + /// Backing field for property. + private string _name; + + /// Operation name: {provider}/{resource}/{operation} + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public OperationAutoGenerated() + { + + } + } + /// CDN REST API operation + public partial interface IOperationAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation type: Read, write, delete, etc.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; set; } + /// Service provider: Microsoft.Cdn + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Service provider: Microsoft.Cdn", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; set; } + /// Resource on which the operation is performed: Profile, endpoint, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource on which the operation is performed: Profile, endpoint, etc.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; set; } + /// Operation name: {provider}/{resource}/{operation} + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation name: {provider}/{resource}/{operation}", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// CDN REST API operation + internal partial interface IOperationAutoGeneratedInternal + + { + /// The object that represents the operation. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplay Display { get; set; } + /// Operation type: Read, write, delete, etc. + string DisplayOperation { get; set; } + /// Service provider: Microsoft.Cdn + string DisplayProvider { get; set; } + /// Resource on which the operation is performed: Profile, endpoint, etc. + string DisplayResource { get; set; } + /// Operation name: {provider}/{resource}/{operation} + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.json.cs new file mode 100644 index 000000000000..6cbd4126d88b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationAutoGenerated.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.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// CDN REST API operation + public partial class OperationAutoGenerated + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new OperationAutoGenerated(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal OperationAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationDisplay.FromJson(__jsonDisplay) : Display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.PowerShell.cs new file mode 100644 index 000000000000..45bc98d19006 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// The object that represents the operation. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial class OperationDisplay + { + + /// + /// 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.ApplicationInsights.Models.Api20150501.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationDisplay(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.ApplicationInsights.Models.Api20150501.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationDisplay(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.ApplicationInsights.Models.Api20150501.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationDisplay(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Operation, 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 OperationDisplay(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal)this).Operation, 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.ApplicationInsights.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 object that represents the operation. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial interface IOperationDisplay + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.TypeConverter.cs new file mode 100644 index 000000000000..e5894ad71bbe --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationDisplayTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IOperationDisplay ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplay).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationDisplay.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationDisplay.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationDisplay.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.cs new file mode 100644 index 000000000000..cbb2e08a3db4 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// The object that represents the operation. + public partial class OperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplayInternal + { + + /// Backing field for property. + private string _operation; + + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private string _provider; + + /// Service provider: Microsoft.Cdn + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Provider { get => this._provider; set => this._provider = value; } + + /// Backing field for property. + private string _resource; + + /// Resource on which the operation is performed: Profile, endpoint, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Resource { get => this._resource; set => this._resource = value; } + + /// Creates an new instance. + public OperationDisplay() + { + + } + } + /// The object that represents the operation. + public partial interface IOperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation type: Read, write, delete, etc.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; set; } + /// Service provider: Microsoft.Cdn + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Service provider: Microsoft.Cdn", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; set; } + /// Resource on which the operation is performed: Profile, endpoint, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource on which the operation is performed: Profile, endpoint, etc.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; set; } + + } + /// The object that represents the operation. + internal partial interface IOperationDisplayInternal + + { + /// Operation type: Read, write, delete, etc. + string Operation { get; set; } + /// Service provider: Microsoft.Cdn + string Provider { get; set; } + /// Resource on which the operation is performed: Profile, endpoint, etc. + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.json.cs new file mode 100644 index 000000000000..c1f40c4d14de --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationDisplay.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.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// The object that represents the operation. + public partial class OperationDisplay + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.PowerShell.cs new file mode 100644 index 000000000000..0fc7f7f38ffa --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. + /// + [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] + public partial class OperationListResult + { + + /// + /// 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.ApplicationInsights.Models.Api20150501.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationListResult(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.ApplicationInsights.Models.Api20150501.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationListResult(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.ApplicationInsights.Models.Api20150501.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationListResult(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.ApplicationInsights.Models.Api20150501.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationAutoGeneratedTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResultInternal)this).NextLink, 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 OperationListResult(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.ApplicationInsights.Models.Api20150501.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationAutoGeneratedTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResultInternal)this).NextLink, 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.ApplicationInsights.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(); + } + } + /// Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. + [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] + public partial interface IOperationListResult + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.TypeConverter.cs new file mode 100644 index 000000000000..9a363af2767b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.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.ApplicationInsights.Models.Api20150501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationListResultTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20150501.IOperationListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationListResult.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.cs new file mode 100644 index 000000000000..29ba5de70a5a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. + /// + public partial class OperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// URL to get the next set of operation list results if there are any. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated[] _value; + + /// List of CDN operations supported by the CDN resource provider. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public OperationListResult() + { + + } + } + /// Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. + public partial interface IOperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// URL to get the next set of operation list results if there are any. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL to get the next set of operation list results if there are any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// List of CDN operations supported by the CDN resource provider. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of CDN operations supported by the CDN resource provider.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated[] Value { get; set; } + + } + /// Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. + internal partial interface IOperationListResultInternal + + { + /// URL to get the next set of operation list results if there are any. + string NextLink { get; set; } + /// List of CDN operations supported by the CDN resource provider. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.json.cs new file mode 100644 index 000000000000..8c610512b405 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/OperationListResult.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. + /// + public partial class OperationListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.OperationAutoGenerated.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/HeaderField.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/HeaderField.PowerShell.cs index 8f7a99f3bc5e..37415ee361aa 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/HeaderField.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/HeaderField.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/HeaderField.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/HeaderField.TypeConverter.cs index 74c044f3ec90..45e5ac23dc7e 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/HeaderField.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/HeaderField.TypeConverter.cs @@ -26,8 +26,7 @@ public partial class HeaderFieldTypeConverter : global::System.Management.Automa public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/Operation.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/Operation.PowerShell.cs index 0901e635445e..b65269a680ba 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/Operation.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/Operation.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/Operation.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/Operation.TypeConverter.cs index 5df6b2368202..6a1f4c9fc965 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/Operation.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/Operation.TypeConverter.cs @@ -26,8 +26,7 @@ public partial class OperationTypeConverter : global::System.Management.Automati public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationInfo.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationInfo.PowerShell.cs index d2253ad49d30..5fb0a31c0988 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationInfo.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationInfo.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IOperationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationInfo.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationInfo.TypeConverter.cs index 9ff9e80efa7e..83d99f374252 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationInfo.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationInfo.TypeConverter.cs @@ -26,8 +26,7 @@ public partial class OperationInfoTypeConverter : global::System.Management.Auto public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationsListResult.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationsListResult.PowerShell.cs index 00d1d97053b4..3f33f6a7dc25 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationsListResult.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationsListResult.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IOperationsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationsListResult.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationsListResult.TypeConverter.cs index 675ee99665f9..7a02bc3f42ed 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationsListResult.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/OperationsListResult.TypeConverter.cs @@ -26,8 +26,8 @@ public partial class OperationsListResultTypeConverter : global::System.Manageme public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResource.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResource.PowerShell.cs index cdca0dda058c..4740b52ebcc8 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResource.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResource.PowerShell.cs @@ -94,7 +94,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResource.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResource.TypeConverter.cs index 99334e8e8315..fc01e69ee1ec 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResource.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResource.TypeConverter.cs @@ -26,8 +26,7 @@ public partial class TagsResourceTypeConverter : global::System.Management.Autom public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResourceTags.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResourceTags.PowerShell.cs index 8e08f417ebb2..e6ede1c0c551 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResourceTags.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResourceTags.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResourceTags.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResourceTags.TypeConverter.cs index ac823750507a..b235a41315aa 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResourceTags.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/TagsResourceTags.TypeConverter.cs @@ -26,8 +26,7 @@ public partial class TagsResourceTagsTypeConverter : global::System.Management.A public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.PowerShell.cs index 4682c9bcd217..15c19dce5eea 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.PowerShell.cs @@ -90,7 +90,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.TypeConverter.cs index 855cfe0bc4f7..366c5cfc600f 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.TypeConverter.cs @@ -26,8 +26,7 @@ public partial class WebTestTypeConverter : global::System.Management.Automation public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.cs index f8748621bcb6..865bf0a37edc 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTest.cs @@ -162,7 +162,8 @@ public partial class WebTest : /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/").Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/").Match(this.Id).Groups["resourceGroupName"].Value : null); } + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// Allow for retries should this WebTest fail. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] @@ -226,7 +227,7 @@ public partial class WebTest : /// an instance that will receive validation /// events. /// - /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// A that will be complete when validation is completed. /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestGeolocation.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestGeolocation.PowerShell.cs index b7698b206751..e444db0bc128 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestGeolocation.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestGeolocation.PowerShell.cs @@ -94,7 +94,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestGeolocation.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestGeolocation.TypeConverter.cs index 1139959363a3..7e58cc1669bc 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestGeolocation.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestGeolocation.TypeConverter.cs @@ -26,8 +26,8 @@ public partial class WebTestGeolocationTypeConverter : global::System.Management public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestListResult.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestListResult.PowerShell.cs index ca229a7e020d..75c307a5d2ab 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestListResult.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestListResult.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestListResult.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestListResult.TypeConverter.cs index cfe8081b8ff6..3e9c174068f8 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestListResult.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestListResult.TypeConverter.cs @@ -26,8 +26,7 @@ public partial class WebTestListResultTypeConverter : global::System.Management. public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestProperties.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestProperties.PowerShell.cs index 900e96ee24d4..aa4648f49c7f 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestProperties.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestProperties.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestProperties.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestProperties.TypeConverter.cs index 0ee7509b8fc2..9d9461a613e6 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestProperties.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestProperties.TypeConverter.cs @@ -26,8 +26,7 @@ public partial class WebTestPropertiesTypeConverter : global::System.Management. public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesConfiguration.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesConfiguration.PowerShell.cs index 2ef8346cad4a..ed5c005ae5aa 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesConfiguration.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesConfiguration.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestPropertiesConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesConfiguration.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesConfiguration.TypeConverter.cs index b2b87804cb58..d9b60a240ed8 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesConfiguration.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesConfiguration.TypeConverter.cs @@ -26,8 +26,8 @@ public partial class WebTestPropertiesConfigurationTypeConverter : global::Syste public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesRequest.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesRequest.PowerShell.cs index db8fcb3b1896..68553beac291 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesRequest.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesRequest.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestPropertiesRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesRequest.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesRequest.TypeConverter.cs index aee799ff6c55..7e9a272bc8c6 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesRequest.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesRequest.TypeConverter.cs @@ -26,8 +26,8 @@ public partial class WebTestPropertiesRequestTypeConverter : global::System.Mana public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRules.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRules.PowerShell.cs index 4bcc7c44b7a1..64315c3462fc 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRules.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRules.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestPropertiesValidationRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRules.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRules.TypeConverter.cs index 783a60f71beb..6980d7c174d6 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRules.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRules.TypeConverter.cs @@ -26,8 +26,8 @@ public partial class WebTestPropertiesValidationRulesTypeConverter : global::Sys public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs index 8ba8672f5026..167b7ede6047 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs @@ -93,7 +93,9 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. + /// + /// an instance of the model class. + /// public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestPropertiesValidationRulesContentValidation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRulesContentValidation.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRulesContentValidation.TypeConverter.cs index 4411095e6da0..54ed7895a6ba 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRulesContentValidation.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebTestPropertiesValidationRulesContentValidation.TypeConverter.cs @@ -27,8 +27,8 @@ public partial class WebTestPropertiesValidationRulesContentValidationTypeConver public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResource.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResource.PowerShell.cs index 6e16a4c95888..b50a9632dd81 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResource.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResource.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResource.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResource.TypeConverter.cs index 5dbfaedcb704..4c665fe24503 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResource.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResource.TypeConverter.cs @@ -26,8 +26,7 @@ public partial class WebtestsResourceTypeConverter : global::System.Management.A public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResourceTags.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResourceTags.PowerShell.cs index 68bec04befdf..5458ac48f6c6 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResourceTags.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResourceTags.PowerShell.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResourceTags.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResourceTags.TypeConverter.cs index 782d5d4fd618..273acddd8e56 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResourceTags.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20180501Preview/WebtestsResourceTags.TypeConverter.cs @@ -26,8 +26,8 @@ public partial class WebtestsResourceTagsTypeConverter : global::System.Manageme public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.PowerShell.cs new file mode 100644 index 000000000000..61b2619a85d8 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.PowerShell.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component definition. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentTypeConverter))] + public partial class ApplicationInsightsComponent + { + + /// + /// 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 ApplicationInsightsComponent(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ApplicationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType) content.GetValueForProperty("ApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType.CreateFrom); + } + if (content.Contains("FlowType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).FlowType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType?) content.GetValueForProperty("FlowType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).FlowType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType.CreateFrom); + } + if (content.Contains("RequestSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RequestSource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource?) content.GetValueForProperty("RequestSource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RequestSource, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource.CreateFrom); + } + if (content.Contains("IngestionMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).IngestionMode = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode?) content.GetValueForProperty("IngestionMode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).IngestionMode, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode.CreateFrom); + } + if (content.Contains("ApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).AppId, global::System.Convert.ToString); + } + if (content.Contains("PropertiesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PropertiesName, global::System.Convert.ToString); + } + if (content.Contains("InstrumentationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).InstrumentationKey, global::System.Convert.ToString); + } + if (content.Contains("CreationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).CreationDate = (global::System.DateTime?) content.GetValueForProperty("CreationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).CreationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppId = (string) content.GetValueForProperty("HockeyAppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppToken = (string) content.GetValueForProperty("HockeyAppToken",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppToken, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SamplingPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).SamplingPercentage = (double?) content.GetValueForProperty("SamplingPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).SamplingPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("RetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisableIPMasking")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableIPMasking = (bool?) content.GetValueForProperty("DisableIPMasking",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableIPMasking, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmediatePurgeDataOn30Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day = (bool?) content.GetValueForProperty("ImmediatePurgeDataOn30Day",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).WorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("LaMigrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).LaMigrationDate = (global::System.DateTime?) content.GetValueForProperty("LaMigrationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).LaMigrationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateLinkScopedResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[]) content.GetValueForProperty("PrivateLinkScopedResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.PrivateLinkScopedResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccessForIngestion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForIngestion",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); + } + if (content.Contains("PublicNetworkAccessForQuery")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForQuery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ForceCustomerStorageForProfiler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ForceCustomerStorageForProfiler = (bool?) content.GetValueForProperty("ForceCustomerStorageForProfiler",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ForceCustomerStorageForProfiler, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponent(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ApplicationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType) content.GetValueForProperty("ApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType.CreateFrom); + } + if (content.Contains("FlowType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).FlowType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType?) content.GetValueForProperty("FlowType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).FlowType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType.CreateFrom); + } + if (content.Contains("RequestSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RequestSource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource?) content.GetValueForProperty("RequestSource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RequestSource, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource.CreateFrom); + } + if (content.Contains("IngestionMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).IngestionMode = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode?) content.GetValueForProperty("IngestionMode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).IngestionMode, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode.CreateFrom); + } + if (content.Contains("ApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).AppId, global::System.Convert.ToString); + } + if (content.Contains("PropertiesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PropertiesName, global::System.Convert.ToString); + } + if (content.Contains("InstrumentationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).InstrumentationKey, global::System.Convert.ToString); + } + if (content.Contains("CreationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).CreationDate = (global::System.DateTime?) content.GetValueForProperty("CreationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).CreationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppId = (string) content.GetValueForProperty("HockeyAppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppToken = (string) content.GetValueForProperty("HockeyAppToken",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppToken, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SamplingPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).SamplingPercentage = (double?) content.GetValueForProperty("SamplingPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).SamplingPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("RetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisableIPMasking")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableIPMasking = (bool?) content.GetValueForProperty("DisableIPMasking",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableIPMasking, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmediatePurgeDataOn30Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day = (bool?) content.GetValueForProperty("ImmediatePurgeDataOn30Day",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).WorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("LaMigrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).LaMigrationDate = (global::System.DateTime?) content.GetValueForProperty("LaMigrationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).LaMigrationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateLinkScopedResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[]) content.GetValueForProperty("PrivateLinkScopedResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.PrivateLinkScopedResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccessForIngestion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForIngestion",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); + } + if (content.Contains("PublicNetworkAccessForQuery")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForQuery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ForceCustomerStorageForProfiler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ForceCustomerStorageForProfiler = (bool?) content.GetValueForProperty("ForceCustomerStorageForProfiler",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ForceCustomerStorageForProfiler, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponent(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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponent(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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component definition. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentTypeConverter))] + public partial interface IApplicationInsightsComponent + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.TypeConverter.cs new file mode 100644 index 000000000000..3367924822f7 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponent.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponent.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponent.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.cs new file mode 100644 index 000000000000..bf2721180d89 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.cs @@ -0,0 +1,596 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component definition. + public partial class ApplicationInsightsComponent : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource __componentsResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResource(); + + /// Application Insights Unique ID for your Application. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).AppId; } + + /// + /// The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string ApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationId; } + + /// Type of application being monitored. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType? ApplicationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType)""); } + + /// Application Insights component connection string. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string ConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ConnectionString; } + + /// Creation Date for the Application Insights component, in ISO 8601 format. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public global::System.DateTime? CreationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).CreationDate; } + + /// Disable IP masking. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public bool? DisableIPMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).DisableIPMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).DisableIPMasking = value ?? default(bool); } + + /// Disable Non-AAD based Auth. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public bool? DisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } + + /// Backing field for property. + private string _etag; + + /// Resource etag + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Etag { get => this._etag; set => this._etag = value; } + + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType? FlowType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).FlowType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).FlowType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType)""); } + + /// Force users to create their own storage account for profiler and debugger. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public bool? ForceCustomerStorageForProfiler { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ForceCustomerStorageForProfiler; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ForceCustomerStorageForProfiler = value ?? default(bool); } + + /// + /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string HockeyAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppId = value ?? null; } + + /// + /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string HockeyAppToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppToken; } + + /// Azure resource Id + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Id; } + + /// Purge data immediately after 30 days. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public bool? ImmediatePurgeDataOn30Day { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ImmediatePurgeDataOn30Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ImmediatePurgeDataOn30Day = value ?? default(bool); } + + /// Indicates the flow of the ingestion. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode? IngestionMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).IngestionMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).IngestionMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode)""); } + + /// + /// Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for + /// all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application + /// Insights component. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string InstrumentationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).InstrumentationKey; } + + /// Backing field for property. + private string _kind; + + /// + /// The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should + /// typically be one of the following: web, ios, other, store, java, phone. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Kind { get => this._kind; set => this._kind = value; } + + /// The date which the component got migrated to LA, in ISO 8601 format. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public global::System.DateTime? LaMigrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).LaMigrationDate; } + + /// Resource location + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Location = value ; } + + /// Internal Acessors for AppId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).AppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).AppId = value; } + + /// Internal Acessors for ApplicationId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.ApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationId = value; } + + /// Internal Acessors for ConnectionString + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.ConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ConnectionString = value; } + + /// Internal Acessors for CreationDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.CreationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).CreationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).CreationDate = value; } + + /// Internal Acessors for HockeyAppToken + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.HockeyAppToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppToken = value; } + + /// Internal Acessors for InstrumentationKey + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.InstrumentationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).InstrumentationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).InstrumentationKey = value; } + + /// Internal Acessors for LaMigrationDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.LaMigrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).LaMigrationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).LaMigrationDate = value; } + + /// Internal Acessors for PrivateLinkScopedResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.PrivateLinkScopedResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PrivateLinkScopedResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PrivateLinkScopedResource = value; } + + /// Internal Acessors for PropertiesName + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).Name = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).TenantId = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Type = value; } + + /// Azure resource name + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Name; } + + /// List of linked private link scope resources. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] PrivateLinkScopedResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PrivateLinkScopedResource; } + + /// Application name. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties _property; + + /// Properties that define an Application Insights component resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentProperties()); set => this._property = value; } + + /// + /// Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users + /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ProvisioningState; } + + /// The network access type for accessing Application Insights ingestion. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForIngestion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForIngestion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForIngestion = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType)""); } + + /// The network access type for accessing Application Insights query. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForQuery = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType)""); } + + /// + /// Describes what tool created this Application Insights component. Customers using this API should set this to the default + /// 'rest'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource? RequestSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).RequestSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).RequestSource = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource)""); } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// Retention period in days. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public int? RetentionInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).RetentionInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).RetentionInDay = value ?? default(int); } + + /// + /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public double? SamplingPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).SamplingPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).SamplingPercentage = value ?? default(double); } + + /// Resource tags + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Tag = value ?? null /* model class */; } + + /// Azure Tenant Id. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).TenantId; } + + /// Azure resource type + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Type; } + + /// + /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an + /// application with this API version. Applications from older versions will not have this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string WorkspaceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).WorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).WorkspaceResourceId = value ?? null; } + + /// Creates an new instance. + public ApplicationInsightsComponent() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__componentsResource), __componentsResource); + await eventListener.AssertObjectIsValid(nameof(__componentsResource), __componentsResource); + } + } + /// An Application Insights component definition. + public partial interface IApplicationInsightsComponent : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource + { + /// Application Insights Unique ID for your Application. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Application Insights Unique ID for your Application.", + SerializedName = @"AppId", + PossibleTypes = new [] { typeof(string) })] + string AppId { get; } + /// + /// The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unique ID of your application. This field mirrors the 'Name' field and cannot be changed.", + SerializedName = @"ApplicationId", + PossibleTypes = new [] { typeof(string) })] + string ApplicationId { get; } + /// Type of application being monitored. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of application being monitored.", + SerializedName = @"Application_Type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType? ApplicationType { get; set; } + /// Application Insights component connection string. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Application Insights component connection string.", + SerializedName = @"ConnectionString", + PossibleTypes = new [] { typeof(string) })] + string ConnectionString { get; } + /// Creation Date for the Application Insights component, in ISO 8601 format. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Creation Date for the Application Insights component, in ISO 8601 format.", + SerializedName = @"CreationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreationDate { get; } + /// Disable IP masking. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disable IP masking.", + SerializedName = @"DisableIpMasking", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableIPMasking { get; set; } + /// Disable Non-AAD based Auth. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disable Non-AAD based Auth.", + SerializedName = @"DisableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// Resource etag + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource etag", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; set; } + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.", + SerializedName = @"Flow_Type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType? FlowType { get; set; } + /// Force users to create their own storage account for profiler and debugger. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Force users to create their own storage account for profiler and debugger.", + SerializedName = @"ForceCustomerStorageForProfiler", + PossibleTypes = new [] { typeof(bool) })] + bool? ForceCustomerStorageForProfiler { get; set; } + /// + /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp.", + SerializedName = @"HockeyAppId", + PossibleTypes = new [] { typeof(string) })] + string HockeyAppId { get; set; } + /// + /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Token used to authenticate communications with between Application Insights and HockeyApp.", + SerializedName = @"HockeyAppToken", + PossibleTypes = new [] { typeof(string) })] + string HockeyAppToken { get; } + /// Purge data immediately after 30 days. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Purge data immediately after 30 days.", + SerializedName = @"ImmediatePurgeDataOn30Days", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmediatePurgeDataOn30Day { get; set; } + /// Indicates the flow of the ingestion. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the flow of the ingestion.", + SerializedName = @"IngestionMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode? IngestionMode { get; set; } + /// + /// Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for + /// all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application + /// Insights component. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application Insights component.", + SerializedName = @"InstrumentationKey", + PossibleTypes = new [] { typeof(string) })] + string InstrumentationKey { get; } + /// + /// The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should + /// typically be one of the following: web, ios, other, store, java, phone. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + string Kind { get; set; } + /// The date which the component got migrated to LA, in ISO 8601 format. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date which the component got migrated to LA, in ISO 8601 format.", + SerializedName = @"LaMigrationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LaMigrationDate { get; } + /// List of linked private link scope resources. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of linked private link scope resources.", + SerializedName = @"PrivateLinkScopedResources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] PrivateLinkScopedResource { get; } + /// Application name. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Application name.", + SerializedName = @"Name", + PossibleTypes = new [] { typeof(string) })] + string PropertiesName { get; } + /// + /// Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users + /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// The network access type for accessing Application Insights ingestion. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network access type for accessing Application Insights ingestion.", + SerializedName = @"publicNetworkAccessForIngestion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForIngestion { get; set; } + /// The network access type for accessing Application Insights query. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network access type for accessing Application Insights query.", + SerializedName = @"publicNetworkAccessForQuery", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForQuery { get; set; } + /// + /// Describes what tool created this Application Insights component. Customers using this API should set this to the default + /// 'rest'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.", + SerializedName = @"Request_Source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource? RequestSource { get; set; } + /// Retention period in days. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention period in days.", + SerializedName = @"RetentionInDays", + PossibleTypes = new [] { typeof(int) })] + int? RetentionInDay { get; set; } + /// + /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry.", + SerializedName = @"SamplingPercentage", + PossibleTypes = new [] { typeof(double) })] + double? SamplingPercentage { get; set; } + /// Azure Tenant Id. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure Tenant Id.", + SerializedName = @"TenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; } + /// + /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an + /// application with this API version. Applications from older versions will not have this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an application with this API version. Applications from older versions will not have this property.", + SerializedName = @"WorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + string WorkspaceResourceId { get; set; } + + } + /// An Application Insights component definition. + internal partial interface IApplicationInsightsComponentInternal : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal + { + /// Application Insights Unique ID for your Application. + string AppId { get; set; } + /// + /// The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. + /// + string ApplicationId { get; set; } + /// Type of application being monitored. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType? ApplicationType { get; set; } + /// Application Insights component connection string. + string ConnectionString { get; set; } + /// Creation Date for the Application Insights component, in ISO 8601 format. + global::System.DateTime? CreationDate { get; set; } + /// Disable IP masking. + bool? DisableIPMasking { get; set; } + /// Disable Non-AAD based Auth. + bool? DisableLocalAuth { get; set; } + /// Resource etag + string Etag { get; set; } + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType? FlowType { get; set; } + /// Force users to create their own storage account for profiler and debugger. + bool? ForceCustomerStorageForProfiler { get; set; } + /// + /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// + string HockeyAppId { get; set; } + /// + /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// + string HockeyAppToken { get; set; } + /// Purge data immediately after 30 days. + bool? ImmediatePurgeDataOn30Day { get; set; } + /// Indicates the flow of the ingestion. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode? IngestionMode { get; set; } + /// + /// Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for + /// all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application + /// Insights component. + /// + string InstrumentationKey { get; set; } + /// + /// The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should + /// typically be one of the following: web, ios, other, store, java, phone. + /// + string Kind { get; set; } + /// The date which the component got migrated to LA, in ISO 8601 format. + global::System.DateTime? LaMigrationDate { get; set; } + /// List of linked private link scope resources. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] PrivateLinkScopedResource { get; set; } + /// Application name. + string PropertiesName { get; set; } + /// Properties that define an Application Insights component resource. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties Property { get; set; } + /// + /// Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users + /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + /// + string ProvisioningState { get; set; } + /// The network access type for accessing Application Insights ingestion. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForIngestion { get; set; } + /// The network access type for accessing Application Insights query. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForQuery { get; set; } + /// + /// Describes what tool created this Application Insights component. Customers using this API should set this to the default + /// 'rest'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource? RequestSource { get; set; } + /// Retention period in days. + int? RetentionInDay { get; set; } + /// + /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// + double? SamplingPercentage { get; set; } + /// Azure Tenant Id. + string TenantId { get; set; } + /// + /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an + /// application with this API version. Applications from older versions will not have this property. + /// + string WorkspaceResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.json.cs new file mode 100644 index 000000000000..45c2a5ae46a3 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component definition. + public partial class ApplicationInsightsComponent + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponent(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __componentsResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentProperties.FromJson(__jsonProperties) : Property;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponent(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __componentsResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.PowerShell.cs new file mode 100644 index 000000000000..b7dfd8cdc64d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.PowerShell.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Describes the list of Application Insights Resources. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentListResultTypeConverter))] + public partial class ApplicationInsightsComponentListResult + { + + /// + /// 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 ApplicationInsightsComponentListResult(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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).NextLink, 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 ApplicationInsightsComponentListResult(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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).NextLink, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentListResult(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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentListResult(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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Describes the list of Application Insights Resources. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentListResultTypeConverter))] + public partial interface IApplicationInsightsComponentListResult + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.TypeConverter.cs new file mode 100644 index 000000000000..7305ef616a7d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentListResultTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentListResult.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.cs new file mode 100644 index 000000000000..cb5cc7997c59 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Describes the list of Application Insights Resources. + public partial class ApplicationInsightsComponentListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// + /// The URI to get the next set of Application Insights component definitions if too many components where returned in the + /// result set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent[] _value; + + /// List of Application Insights component definitions. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ApplicationInsightsComponentListResult() + { + + } + } + /// Describes the list of Application Insights Resources. + public partial interface IApplicationInsightsComponentListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// + /// The URI to get the next set of Application Insights component definitions if too many components where returned in the + /// result set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URI to get the next set of Application Insights component definitions if too many components where returned in the result set.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// List of Application Insights component definitions. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of Application Insights component definitions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent[] Value { get; set; } + + } + /// Describes the list of Application Insights Resources. + internal partial interface IApplicationInsightsComponentListResultInternal + + { + /// + /// The URI to get the next set of Application Insights component definitions if too many components where returned in the + /// result set. + /// + string NextLink { get; set; } + /// List of Application Insights component definitions. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.json.cs new file mode 100644 index 000000000000..dd14652f2265 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Describes the list of Application Insights Resources. + public partial class ApplicationInsightsComponentListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentListResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.PowerShell.cs new file mode 100644 index 000000000000..424828392b2d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.PowerShell.cs @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Properties that define an Application Insights component resource. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentPropertiesTypeConverter))] + public partial class ApplicationInsightsComponentProperties + { + + /// + /// 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 ApplicationInsightsComponentProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).AppId, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("ApplicationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ApplicationType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType) content.GetValueForProperty("ApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ApplicationType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType.CreateFrom); + } + if (content.Contains("FlowType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).FlowType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType?) content.GetValueForProperty("FlowType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).FlowType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType.CreateFrom); + } + if (content.Contains("RequestSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).RequestSource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource?) content.GetValueForProperty("RequestSource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).RequestSource, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource.CreateFrom); + } + if (content.Contains("InstrumentationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).InstrumentationKey, global::System.Convert.ToString); + } + if (content.Contains("CreationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).CreationDate = (global::System.DateTime?) content.GetValueForProperty("CreationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).CreationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppId = (string) content.GetValueForProperty("HockeyAppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppToken = (string) content.GetValueForProperty("HockeyAppToken",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppToken, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SamplingPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).SamplingPercentage = (double?) content.GetValueForProperty("SamplingPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).SamplingPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("RetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).RetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisableIPMasking")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).DisableIPMasking = (bool?) content.GetValueForProperty("DisableIPMasking",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).DisableIPMasking, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmediatePurgeDataOn30Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ImmediatePurgeDataOn30Day = (bool?) content.GetValueForProperty("ImmediatePurgeDataOn30Day",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ImmediatePurgeDataOn30Day, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).WorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("LaMigrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).LaMigrationDate = (global::System.DateTime?) content.GetValueForProperty("LaMigrationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).LaMigrationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateLinkScopedResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PrivateLinkScopedResource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[]) content.GetValueForProperty("PrivateLinkScopedResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PrivateLinkScopedResource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.PrivateLinkScopedResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccessForIngestion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForIngestion = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForIngestion",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForIngestion, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); + } + if (content.Contains("PublicNetworkAccessForQuery")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForQuery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForQuery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForQuery, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); + } + if (content.Contains("IngestionMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).IngestionMode = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode?) content.GetValueForProperty("IngestionMode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).IngestionMode, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode.CreateFrom); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ForceCustomerStorageForProfiler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ForceCustomerStorageForProfiler = (bool?) content.GetValueForProperty("ForceCustomerStorageForProfiler",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ForceCustomerStorageForProfiler, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).AppId, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("ApplicationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ApplicationType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType) content.GetValueForProperty("ApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ApplicationType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType.CreateFrom); + } + if (content.Contains("FlowType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).FlowType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType?) content.GetValueForProperty("FlowType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).FlowType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType.CreateFrom); + } + if (content.Contains("RequestSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).RequestSource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource?) content.GetValueForProperty("RequestSource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).RequestSource, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource.CreateFrom); + } + if (content.Contains("InstrumentationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).InstrumentationKey, global::System.Convert.ToString); + } + if (content.Contains("CreationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).CreationDate = (global::System.DateTime?) content.GetValueForProperty("CreationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).CreationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppId = (string) content.GetValueForProperty("HockeyAppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppToken = (string) content.GetValueForProperty("HockeyAppToken",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppToken, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SamplingPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).SamplingPercentage = (double?) content.GetValueForProperty("SamplingPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).SamplingPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("RetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).RetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisableIPMasking")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).DisableIPMasking = (bool?) content.GetValueForProperty("DisableIPMasking",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).DisableIPMasking, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmediatePurgeDataOn30Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ImmediatePurgeDataOn30Day = (bool?) content.GetValueForProperty("ImmediatePurgeDataOn30Day",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ImmediatePurgeDataOn30Day, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).WorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("LaMigrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).LaMigrationDate = (global::System.DateTime?) content.GetValueForProperty("LaMigrationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).LaMigrationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateLinkScopedResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PrivateLinkScopedResource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[]) content.GetValueForProperty("PrivateLinkScopedResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PrivateLinkScopedResource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.PrivateLinkScopedResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccessForIngestion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForIngestion = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForIngestion",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForIngestion, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); + } + if (content.Contains("PublicNetworkAccessForQuery")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForQuery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForQuery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForQuery, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); + } + if (content.Contains("IngestionMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).IngestionMode = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode?) content.GetValueForProperty("IngestionMode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).IngestionMode, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode.CreateFrom); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ForceCustomerStorageForProfiler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ForceCustomerStorageForProfiler = (bool?) content.GetValueForProperty("ForceCustomerStorageForProfiler",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)this).ForceCustomerStorageForProfiler, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ApplicationInsightsComponentProperties(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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentProperties(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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Properties that define an Application Insights component resource. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentPropertiesTypeConverter))] + public partial interface IApplicationInsightsComponentProperties + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.TypeConverter.cs new file mode 100644 index 000000000000..174a3d1bf652 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ApplicationInsightsComponentPropertiesTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ApplicationInsightsComponentProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ApplicationInsightsComponentProperties.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.cs new file mode 100644 index 000000000000..beddade7d4cc --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.cs @@ -0,0 +1,564 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Properties that define an Application Insights component resource. + public partial class ApplicationInsightsComponentProperties : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal + { + + /// Backing field for property. + private string _appId; + + /// Application Insights Unique ID for your Application. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string AppId { get => this._appId; } + + /// Backing field for property. + private string _applicationId; + + /// + /// The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ApplicationId { get => this._applicationId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType _applicationType; + + /// Type of application being monitored. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType ApplicationType { get => this._applicationType; set => this._applicationType = value; } + + /// Backing field for property. + private string _connectionString; + + /// Application Insights component connection string. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ConnectionString { get => this._connectionString; } + + /// Backing field for property. + private global::System.DateTime? _creationDate; + + /// Creation Date for the Application Insights component, in ISO 8601 format. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public global::System.DateTime? CreationDate { get => this._creationDate; } + + /// Backing field for property. + private bool? _disableIPMasking; + + /// Disable IP masking. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? DisableIPMasking { get => this._disableIPMasking; set => this._disableIPMasking = value; } + + /// Backing field for property. + private bool? _disableLocalAuth; + + /// Disable Non-AAD based Auth. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? DisableLocalAuth { get => this._disableLocalAuth; set => this._disableLocalAuth = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType? _flowType; + + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType? FlowType { get => this._flowType; set => this._flowType = value; } + + /// Backing field for property. + private bool? _forceCustomerStorageForProfiler; + + /// Force users to create their own storage account for profiler and debugger. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? ForceCustomerStorageForProfiler { get => this._forceCustomerStorageForProfiler; set => this._forceCustomerStorageForProfiler = value; } + + /// Backing field for property. + private string _hockeyAppId; + + /// + /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string HockeyAppId { get => this._hockeyAppId; set => this._hockeyAppId = value; } + + /// Backing field for property. + private string _hockeyAppToken; + + /// + /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string HockeyAppToken { get => this._hockeyAppToken; } + + /// Backing field for property. + private bool? _immediatePurgeDataOn30Day; + + /// Purge data immediately after 30 days. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? ImmediatePurgeDataOn30Day { get => this._immediatePurgeDataOn30Day; set => this._immediatePurgeDataOn30Day = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode? _ingestionMode; + + /// Indicates the flow of the ingestion. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode? IngestionMode { get => this._ingestionMode; set => this._ingestionMode = value; } + + /// Backing field for property. + private string _instrumentationKey; + + /// + /// Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for + /// all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application + /// Insights component. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string InstrumentationKey { get => this._instrumentationKey; } + + /// Backing field for property. + private global::System.DateTime? _laMigrationDate; + + /// The date which the component got migrated to LA, in ISO 8601 format. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public global::System.DateTime? LaMigrationDate { get => this._laMigrationDate; } + + /// Internal Acessors for AppId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal.AppId { get => this._appId; set { {_appId = value;} } } + + /// Internal Acessors for ApplicationId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal.ApplicationId { get => this._applicationId; set { {_applicationId = value;} } } + + /// Internal Acessors for ConnectionString + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal.ConnectionString { get => this._connectionString; set { {_connectionString = value;} } } + + /// Internal Acessors for CreationDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal.CreationDate { get => this._creationDate; set { {_creationDate = value;} } } + + /// Internal Acessors for HockeyAppToken + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal.HockeyAppToken { get => this._hockeyAppToken; set { {_hockeyAppToken = value;} } } + + /// Internal Acessors for InstrumentationKey + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal.InstrumentationKey { get => this._instrumentationKey; set { {_instrumentationKey = value;} } } + + /// Internal Acessors for LaMigrationDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal.LaMigrationDate { get => this._laMigrationDate; set { {_laMigrationDate = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for PrivateLinkScopedResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal.PrivateLinkScopedResource { get => this._privateLinkScopedResource; set { {_privateLinkScopedResource = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + + /// Backing field for property. + private string _name; + + /// Application name. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] _privateLinkScopedResource; + + /// List of linked private link scope resources. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] PrivateLinkScopedResource { get => this._privateLinkScopedResource; } + + /// Backing field for property. + private string _provisioningState; + + /// + /// Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users + /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? _publicNetworkAccessForIngestion; + + /// The network access type for accessing Application Insights ingestion. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForIngestion { get => this._publicNetworkAccessForIngestion; set => this._publicNetworkAccessForIngestion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? _publicNetworkAccessForQuery; + + /// The network access type for accessing Application Insights query. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForQuery { get => this._publicNetworkAccessForQuery; set => this._publicNetworkAccessForQuery = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource? _requestSource; + + /// + /// Describes what tool created this Application Insights component. Customers using this API should set this to the default + /// 'rest'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource? RequestSource { get => this._requestSource; set => this._requestSource = value; } + + /// Backing field for property. + private int? _retentionInDay; + + /// Retention period in days. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public int? RetentionInDay { get => this._retentionInDay; set => this._retentionInDay = value; } + + /// Backing field for property. + private double? _samplingPercentage; + + /// + /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public double? SamplingPercentage { get => this._samplingPercentage; set => this._samplingPercentage = value; } + + /// Backing field for property. + private string _tenantId; + + /// Azure Tenant Id. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; } + + /// Backing field for property. + private string _workspaceResourceId; + + /// + /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an + /// application with this API version. Applications from older versions will not have this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string WorkspaceResourceId { get => this._workspaceResourceId; set => this._workspaceResourceId = value; } + + /// Creates an new instance. + public ApplicationInsightsComponentProperties() + { + + } + } + /// Properties that define an Application Insights component resource. + public partial interface IApplicationInsightsComponentProperties : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Application Insights Unique ID for your Application. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Application Insights Unique ID for your Application.", + SerializedName = @"AppId", + PossibleTypes = new [] { typeof(string) })] + string AppId { get; } + /// + /// The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The unique ID of your application. This field mirrors the 'Name' field and cannot be changed.", + SerializedName = @"ApplicationId", + PossibleTypes = new [] { typeof(string) })] + string ApplicationId { get; } + /// Type of application being monitored. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of application being monitored.", + SerializedName = @"Application_Type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType ApplicationType { get; set; } + /// Application Insights component connection string. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Application Insights component connection string.", + SerializedName = @"ConnectionString", + PossibleTypes = new [] { typeof(string) })] + string ConnectionString { get; } + /// Creation Date for the Application Insights component, in ISO 8601 format. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Creation Date for the Application Insights component, in ISO 8601 format.", + SerializedName = @"CreationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreationDate { get; } + /// Disable IP masking. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disable IP masking.", + SerializedName = @"DisableIpMasking", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableIPMasking { get; set; } + /// Disable Non-AAD based Auth. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disable Non-AAD based Auth.", + SerializedName = @"DisableLocalAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAuth { get; set; } + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.", + SerializedName = @"Flow_Type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType? FlowType { get; set; } + /// Force users to create their own storage account for profiler and debugger. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Force users to create their own storage account for profiler and debugger.", + SerializedName = @"ForceCustomerStorageForProfiler", + PossibleTypes = new [] { typeof(bool) })] + bool? ForceCustomerStorageForProfiler { get; set; } + /// + /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp.", + SerializedName = @"HockeyAppId", + PossibleTypes = new [] { typeof(string) })] + string HockeyAppId { get; set; } + /// + /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Token used to authenticate communications with between Application Insights and HockeyApp.", + SerializedName = @"HockeyAppToken", + PossibleTypes = new [] { typeof(string) })] + string HockeyAppToken { get; } + /// Purge data immediately after 30 days. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Purge data immediately after 30 days.", + SerializedName = @"ImmediatePurgeDataOn30Days", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmediatePurgeDataOn30Day { get; set; } + /// Indicates the flow of the ingestion. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the flow of the ingestion.", + SerializedName = @"IngestionMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode? IngestionMode { get; set; } + /// + /// Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for + /// all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application + /// Insights component. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application Insights component.", + SerializedName = @"InstrumentationKey", + PossibleTypes = new [] { typeof(string) })] + string InstrumentationKey { get; } + /// The date which the component got migrated to LA, in ISO 8601 format. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The date which the component got migrated to LA, in ISO 8601 format.", + SerializedName = @"LaMigrationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LaMigrationDate { get; } + /// Application name. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Application name.", + SerializedName = @"Name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// List of linked private link scope resources. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of linked private link scope resources.", + SerializedName = @"PrivateLinkScopedResources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] PrivateLinkScopedResource { get; } + /// + /// Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users + /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// The network access type for accessing Application Insights ingestion. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network access type for accessing Application Insights ingestion.", + SerializedName = @"publicNetworkAccessForIngestion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForIngestion { get; set; } + /// The network access type for accessing Application Insights query. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network access type for accessing Application Insights query.", + SerializedName = @"publicNetworkAccessForQuery", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForQuery { get; set; } + /// + /// Describes what tool created this Application Insights component. Customers using this API should set this to the default + /// 'rest'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.", + SerializedName = @"Request_Source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource? RequestSource { get; set; } + /// Retention period in days. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention period in days.", + SerializedName = @"RetentionInDays", + PossibleTypes = new [] { typeof(int) })] + int? RetentionInDay { get; set; } + /// + /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry.", + SerializedName = @"SamplingPercentage", + PossibleTypes = new [] { typeof(double) })] + double? SamplingPercentage { get; set; } + /// Azure Tenant Id. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure Tenant Id.", + SerializedName = @"TenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; } + /// + /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an + /// application with this API version. Applications from older versions will not have this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an application with this API version. Applications from older versions will not have this property.", + SerializedName = @"WorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + string WorkspaceResourceId { get; set; } + + } + /// Properties that define an Application Insights component resource. + internal partial interface IApplicationInsightsComponentPropertiesInternal + + { + /// Application Insights Unique ID for your Application. + string AppId { get; set; } + /// + /// The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. + /// + string ApplicationId { get; set; } + /// Type of application being monitored. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType ApplicationType { get; set; } + /// Application Insights component connection string. + string ConnectionString { get; set; } + /// Creation Date for the Application Insights component, in ISO 8601 format. + global::System.DateTime? CreationDate { get; set; } + /// Disable IP masking. + bool? DisableIPMasking { get; set; } + /// Disable Non-AAD based Auth. + bool? DisableLocalAuth { get; set; } + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType? FlowType { get; set; } + /// Force users to create their own storage account for profiler and debugger. + bool? ForceCustomerStorageForProfiler { get; set; } + /// + /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// + string HockeyAppId { get; set; } + /// + /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// + string HockeyAppToken { get; set; } + /// Purge data immediately after 30 days. + bool? ImmediatePurgeDataOn30Day { get; set; } + /// Indicates the flow of the ingestion. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode? IngestionMode { get; set; } + /// + /// Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for + /// all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application + /// Insights component. + /// + string InstrumentationKey { get; set; } + /// The date which the component got migrated to LA, in ISO 8601 format. + global::System.DateTime? LaMigrationDate { get; set; } + /// Application name. + string Name { get; set; } + /// List of linked private link scope resources. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] PrivateLinkScopedResource { get; set; } + /// + /// Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users + /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + /// + string ProvisioningState { get; set; } + /// The network access type for accessing Application Insights ingestion. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForIngestion { get; set; } + /// The network access type for accessing Application Insights query. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForQuery { get; set; } + /// + /// Describes what tool created this Application Insights component. Customers using this API should set this to the default + /// 'rest'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource? RequestSource { get; set; } + /// Retention period in days. + int? RetentionInDay { get; set; } + /// + /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// + double? SamplingPercentage { get; set; } + /// Azure Tenant Id. + string TenantId { get; set; } + /// + /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an + /// application with this API version. Applications from older versions will not have this property. + /// + string WorkspaceResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.json.cs new file mode 100644 index 000000000000..ab9c1011f24c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.json.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.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Properties that define an Application Insights component resource. + public partial class ApplicationInsightsComponentProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ApplicationInsightsComponentProperties(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_applicationId = If( json?.PropertyT("ApplicationId"), out var __jsonApplicationId) ? (string)__jsonApplicationId : (string)ApplicationId;} + {_appId = If( json?.PropertyT("AppId"), out var __jsonAppId) ? (string)__jsonAppId : (string)AppId;} + {_name = If( json?.PropertyT("Name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_applicationType = If( json?.PropertyT("Application_Type"), out var __jsonApplicationType) ? (string)__jsonApplicationType : (string)ApplicationType;} + {_flowType = If( json?.PropertyT("Flow_Type"), out var __jsonFlowType) ? (string)__jsonFlowType : (string)FlowType;} + {_requestSource = If( json?.PropertyT("Request_Source"), out var __jsonRequestSource) ? (string)__jsonRequestSource : (string)RequestSource;} + {_instrumentationKey = If( json?.PropertyT("InstrumentationKey"), out var __jsonInstrumentationKey) ? (string)__jsonInstrumentationKey : (string)InstrumentationKey;} + {_creationDate = If( json?.PropertyT("CreationDate"), out var __jsonCreationDate) ? global::System.DateTime.TryParse((string)__jsonCreationDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreationDateValue) ? __jsonCreationDateValue : CreationDate : CreationDate;} + {_tenantId = If( json?.PropertyT("TenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_hockeyAppId = If( json?.PropertyT("HockeyAppId"), out var __jsonHockeyAppId) ? (string)__jsonHockeyAppId : (string)HockeyAppId;} + {_hockeyAppToken = If( json?.PropertyT("HockeyAppToken"), out var __jsonHockeyAppToken) ? (string)__jsonHockeyAppToken : (string)HockeyAppToken;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_samplingPercentage = If( json?.PropertyT("SamplingPercentage"), out var __jsonSamplingPercentage) ? (double?)__jsonSamplingPercentage : SamplingPercentage;} + {_connectionString = If( json?.PropertyT("ConnectionString"), out var __jsonConnectionString) ? (string)__jsonConnectionString : (string)ConnectionString;} + {_retentionInDay = If( json?.PropertyT("RetentionInDays"), out var __jsonRetentionInDays) ? (int?)__jsonRetentionInDays : RetentionInDay;} + {_disableIPMasking = If( json?.PropertyT("DisableIpMasking"), out var __jsonDisableIPMasking) ? (bool?)__jsonDisableIPMasking : DisableIPMasking;} + {_immediatePurgeDataOn30Day = If( json?.PropertyT("ImmediatePurgeDataOn30Days"), out var __jsonImmediatePurgeDataOn30Days) ? (bool?)__jsonImmediatePurgeDataOn30Days : ImmediatePurgeDataOn30Day;} + {_workspaceResourceId = If( json?.PropertyT("WorkspaceResourceId"), out var __jsonWorkspaceResourceId) ? (string)__jsonWorkspaceResourceId : (string)WorkspaceResourceId;} + {_laMigrationDate = If( json?.PropertyT("LaMigrationDate"), out var __jsonLaMigrationDate) ? global::System.DateTime.TryParse((string)__jsonLaMigrationDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLaMigrationDateValue) ? __jsonLaMigrationDateValue : LaMigrationDate : LaMigrationDate;} + {_privateLinkScopedResource = If( json?.PropertyT("PrivateLinkScopedResources"), out var __jsonPrivateLinkScopedResources) ? If( __jsonPrivateLinkScopedResources as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.PrivateLinkScopedResource.FromJson(__u) )) ))() : null : PrivateLinkScopedResource;} + {_publicNetworkAccessForIngestion = If( json?.PropertyT("publicNetworkAccessForIngestion"), out var __jsonPublicNetworkAccessForIngestion) ? (string)__jsonPublicNetworkAccessForIngestion : (string)PublicNetworkAccessForIngestion;} + {_publicNetworkAccessForQuery = If( json?.PropertyT("publicNetworkAccessForQuery"), out var __jsonPublicNetworkAccessForQuery) ? (string)__jsonPublicNetworkAccessForQuery : (string)PublicNetworkAccessForQuery;} + {_ingestionMode = If( json?.PropertyT("IngestionMode"), out var __jsonIngestionMode) ? (string)__jsonIngestionMode : (string)IngestionMode;} + {_disableLocalAuth = If( json?.PropertyT("DisableLocalAuth"), out var __jsonDisableLocalAuth) ? (bool?)__jsonDisableLocalAuth : DisableLocalAuth;} + {_forceCustomerStorageForProfiler = If( json?.PropertyT("ForceCustomerStorageForProfiler"), out var __jsonForceCustomerStorageForProfiler) ? (bool?)__jsonForceCustomerStorageForProfiler : ForceCustomerStorageForProfiler;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ApplicationInsightsComponentProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._applicationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._applicationId.ToString()) : null, "ApplicationId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._appId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._appId.ToString()) : null, "AppId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._name.ToString()) : null, "Name" ,container.Add ); + } + AddIf( null != (((object)this._applicationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._applicationType.ToString()) : null, "Application_Type" ,container.Add ); + AddIf( null != (((object)this._flowType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._flowType.ToString()) : null, "Flow_Type" ,container.Add ); + AddIf( null != (((object)this._requestSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._requestSource.ToString()) : null, "Request_Source" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._instrumentationKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._instrumentationKey.ToString()) : null, "InstrumentationKey" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._creationDate ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._creationDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "CreationDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "TenantId" ,container.Add ); + } + AddIf( null != (((object)this._hockeyAppId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._hockeyAppId.ToString()) : null, "HockeyAppId" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._hockeyAppToken)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._hockeyAppToken.ToString()) : null, "HockeyAppToken" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AddIf( null != this._samplingPercentage ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNumber((double)this._samplingPercentage) : null, "SamplingPercentage" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._connectionString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._connectionString.ToString()) : null, "ConnectionString" ,container.Add ); + } + AddIf( null != this._retentionInDay ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNumber((int)this._retentionInDay) : null, "RetentionInDays" ,container.Add ); + AddIf( null != this._disableIPMasking ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._disableIPMasking) : null, "DisableIpMasking" ,container.Add ); + AddIf( null != this._immediatePurgeDataOn30Day ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._immediatePurgeDataOn30Day) : null, "ImmediatePurgeDataOn30Days" ,container.Add ); + AddIf( null != (((object)this._workspaceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._workspaceResourceId.ToString()) : null, "WorkspaceResourceId" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._laMigrationDate ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._laMigrationDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "LaMigrationDate" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._privateLinkScopedResource) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __x in this._privateLinkScopedResource ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("PrivateLinkScopedResources",__w); + } + } + AddIf( null != (((object)this._publicNetworkAccessForIngestion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._publicNetworkAccessForIngestion.ToString()) : null, "publicNetworkAccessForIngestion" ,container.Add ); + AddIf( null != (((object)this._publicNetworkAccessForQuery)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._publicNetworkAccessForQuery.ToString()) : null, "publicNetworkAccessForQuery" ,container.Add ); + AddIf( null != (((object)this._ingestionMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._ingestionMode.ToString()) : null, "IngestionMode" ,container.Add ); + AddIf( null != this._disableLocalAuth ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._disableLocalAuth) : null, "DisableLocalAuth" ,container.Add ); + AddIf( null != this._forceCustomerStorageForProfiler ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonBoolean((bool)this._forceCustomerStorageForProfiler) : null, "ForceCustomerStorageForProfiler" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.PowerShell.cs new file mode 100644 index 000000000000..cb749ac6a97e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Describes the body of a purge request for an App Insights component + [System.ComponentModel.TypeConverter(typeof(ComponentPurgeBodyTypeConverter))] + public partial class ComponentPurgeBody + { + + /// + /// 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 ComponentPurgeBody(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyInternal)this).Table, global::System.Convert.ToString); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters[]) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyInternal)this).Filter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBodyFiltersTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ComponentPurgeBody(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyInternal)this).Table, global::System.Convert.ToString); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters[]) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyInternal)this).Filter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBodyFiltersTypeConverter.ConvertFrom)); + } + 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.ApplicationInsights.Models.Api202002.IComponentPurgeBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ComponentPurgeBody(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.ApplicationInsights.Models.Api202002.IComponentPurgeBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentPurgeBody(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.ApplicationInsights.Models.Api202002.IComponentPurgeBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Describes the body of a purge request for an App Insights component + [System.ComponentModel.TypeConverter(typeof(ComponentPurgeBodyTypeConverter))] + public partial interface IComponentPurgeBody + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.TypeConverter.cs new file mode 100644 index 000000000000..495d5b77cf40 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ComponentPurgeBodyTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IComponentPurgeBody ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ComponentPurgeBody.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ComponentPurgeBody.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ComponentPurgeBody.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.cs new file mode 100644 index 000000000000..8c50e31cee8d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.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.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Describes the body of a purge request for an App Insights component + public partial class ComponentPurgeBody : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters[] _filter; + + /// + /// The set of columns and filters (queries) to run over them to purge the resulting data. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters[] Filter { get => this._filter; set => this._filter = value; } + + /// Backing field for property. + private string _table; + + /// Table from which to purge data. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Table { get => this._table; set => this._table = value; } + + /// Creates an new instance. + public ComponentPurgeBody() + { + + } + } + /// Describes the body of a purge request for an App Insights component + public partial interface IComponentPurgeBody : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// + /// The set of columns and filters (queries) to run over them to purge the resulting data. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The set of columns and filters (queries) to run over them to purge the resulting data.", + SerializedName = @"filters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters[] Filter { get; set; } + /// Table from which to purge data. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Table from which to purge data.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string Table { get; set; } + + } + /// Describes the body of a purge request for an App Insights component + internal partial interface IComponentPurgeBodyInternal + + { + /// + /// The set of columns and filters (queries) to run over them to purge the resulting data. + /// + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters[] Filter { get; set; } + /// Table from which to purge data. + string Table { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.json.cs new file mode 100644 index 000000000000..c2207ff9be36 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.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.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Describes the body of a purge request for an App Insights component + public partial class ComponentPurgeBody + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ComponentPurgeBody(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_table = If( json?.PropertyT("table"), out var __jsonTable) ? (string)__jsonTable : (string)Table;} + {_filter = If( json?.PropertyT("filters"), out var __jsonFilters) ? If( __jsonFilters as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBodyFilters.FromJson(__u) )) ))() : null : Filter;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ComponentPurgeBody(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._table)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._table.ToString()) : null, "table" ,container.Add ); + if (null != this._filter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __x in this._filter ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("filters",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.PowerShell.cs new file mode 100644 index 000000000000..585acd0557fe --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// User-defined filters to return data which will be purged from the table. + [System.ComponentModel.TypeConverter(typeof(ComponentPurgeBodyFiltersTypeConverter))] + public partial class ComponentPurgeBodyFilters + { + + /// + /// 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 ComponentPurgeBodyFilters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Column = (string) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Column, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Operator, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Value, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Key, 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 ComponentPurgeBodyFilters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Column = (string) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Column, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Operator, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Value, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Key, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ComponentPurgeBodyFilters(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.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentPurgeBodyFilters(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.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// User-defined filters to return data which will be purged from the table. + [System.ComponentModel.TypeConverter(typeof(ComponentPurgeBodyFiltersTypeConverter))] + public partial interface IComponentPurgeBodyFilters + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.TypeConverter.cs new file mode 100644 index 000000000000..3e2240bd1b85 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ComponentPurgeBodyFiltersTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ComponentPurgeBodyFilters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ComponentPurgeBodyFilters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ComponentPurgeBodyFilters.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.cs new file mode 100644 index 000000000000..4e8546e7d76a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// User-defined filters to return data which will be purged from the table. + public partial class ComponentPurgeBodyFilters : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal + { + + /// Backing field for property. + private string _column; + + /// The column of the table over which the given query should run + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Column { get => this._column; set => this._column = value; } + + /// Backing field for property. + private string _key; + + /// + /// When filtering over custom dimensions, this key will be used as the name of the custom dimension. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Key { get => this._key; set => this._key = value; } + + /// Backing field for property. + private string _operator; + + /// + /// A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, + /// <=, between, and have the same behavior as they would in a KQL query. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Operator { get => this._operator; set => this._operator = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny _value; + + /// + /// the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') + /// or array of values. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Any()); set => this._value = value; } + + /// Creates an new instance. + public ComponentPurgeBodyFilters() + { + + } + } + /// User-defined filters to return data which will be purged from the table. + public partial interface IComponentPurgeBodyFilters : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// The column of the table over which the given query should run + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The column of the table over which the given query should run", + SerializedName = @"column", + PossibleTypes = new [] { typeof(string) })] + string Column { get; set; } + /// + /// When filtering over custom dimensions, this key will be used as the name of the custom dimension. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When filtering over custom dimensions, this key will be used as the name of the custom dimension.", + SerializedName = @"key", + PossibleTypes = new [] { typeof(string) })] + string Key { get; set; } + /// + /// A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, + /// <=, between, and have the same behavior as they would in a KQL query. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string Operator { get; set; } + /// + /// the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') + /// or array of values. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Value { get; set; } + + } + /// User-defined filters to return data which will be purged from the table. + internal partial interface IComponentPurgeBodyFiltersInternal + + { + /// The column of the table over which the given query should run + string Column { get; set; } + /// + /// When filtering over custom dimensions, this key will be used as the name of the custom dimension. + /// + string Key { get; set; } + /// + /// A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, + /// <=, between, and have the same behavior as they would in a KQL query. + /// + string Operator { get; set; } + /// + /// the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') + /// or array of values. + /// + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Value { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.json.cs new file mode 100644 index 000000000000..c010b221783f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// User-defined filters to return data which will be purged from the table. + public partial class ComponentPurgeBodyFilters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ComponentPurgeBodyFilters(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_column = If( json?.PropertyT("column"), out var __jsonColumn) ? (string)__jsonColumn : (string)Column;} + {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)Operator;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Any.FromJson(__jsonValue) : Value;} + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ComponentPurgeBodyFilters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._column)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._column.ToString()) : null, "column" ,container.Add ); + AddIf( null != (((object)this._operator)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._operator.ToString()) : null, "operator" ,container.Add ); + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._value.ToJson(null,serializationMode) : null, "value" ,container.Add ); + AddIf( null != (((object)this._key)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._key.ToString()) : null, "key" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.PowerShell.cs new file mode 100644 index 000000000000..87ac13c83445 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Response containing operationId for a specific purge action. + [System.ComponentModel.TypeConverter(typeof(ComponentPurgeResponseTypeConverter))] + public partial class ComponentPurgeResponse + { + + /// + /// 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 ComponentPurgeResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponseInternal)this).OperationId = (string) content.GetValueForProperty("OperationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponseInternal)this).OperationId, 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 ComponentPurgeResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponseInternal)this).OperationId = (string) content.GetValueForProperty("OperationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponseInternal)this).OperationId, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api202002.IComponentPurgeResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ComponentPurgeResponse(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.ApplicationInsights.Models.Api202002.IComponentPurgeResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentPurgeResponse(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.ApplicationInsights.Models.Api202002.IComponentPurgeResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Response containing operationId for a specific purge action. + [System.ComponentModel.TypeConverter(typeof(ComponentPurgeResponseTypeConverter))] + public partial interface IComponentPurgeResponse + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.TypeConverter.cs new file mode 100644 index 000000000000..5a4e1a6496d7 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ComponentPurgeResponseTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IComponentPurgeResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ComponentPurgeResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ComponentPurgeResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ComponentPurgeResponse.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.cs new file mode 100644 index 000000000000..69372f6ea469 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Response containing operationId for a specific purge action. + public partial class ComponentPurgeResponse : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponseInternal + { + + /// Backing field for property. + private string _operationId; + + /// Id to use when querying for status for a particular purge operation. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// Creates an new instance. + public ComponentPurgeResponse() + { + + } + } + /// Response containing operationId for a specific purge action. + public partial interface IComponentPurgeResponse : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Id to use when querying for status for a particular purge operation. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id to use when querying for status for a particular purge operation.", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + string OperationId { get; set; } + + } + /// Response containing operationId for a specific purge action. + internal partial interface IComponentPurgeResponseInternal + + { + /// Id to use when querying for status for a particular purge operation. + string OperationId { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.json.cs new file mode 100644 index 000000000000..5c4dcf119f21 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Response containing operationId for a specific purge action. + public partial class ComponentPurgeResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ComponentPurgeResponse(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)OperationId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ComponentPurgeResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._operationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._operationId.ToString()) : null, "operationId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.PowerShell.cs new file mode 100644 index 000000000000..b876db69dec0 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Response containing status for a specific purge operation. + [System.ComponentModel.TypeConverter(typeof(ComponentPurgeStatusResponseTypeConverter))] + public partial class ComponentPurgeStatusResponse + { + + /// + /// 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 ComponentPurgeStatusResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponseInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponseInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ComponentPurgeStatusResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponseInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponseInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState.CreateFrom); + } + 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.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ComponentPurgeStatusResponse(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.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentPurgeStatusResponse(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.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Response containing status for a specific purge operation. + [System.ComponentModel.TypeConverter(typeof(ComponentPurgeStatusResponseTypeConverter))] + public partial interface IComponentPurgeStatusResponse + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.TypeConverter.cs new file mode 100644 index 000000000000..fd65393af40e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ComponentPurgeStatusResponseTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ComponentPurgeStatusResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ComponentPurgeStatusResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ComponentPurgeStatusResponse.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.cs new file mode 100644 index 000000000000..7e350dcdf35f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Response containing status for a specific purge operation. + public partial class ComponentPurgeStatusResponse : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponseInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState _status; + + /// Status of the operation represented by the requested Id. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public ComponentPurgeStatusResponse() + { + + } + } + /// Response containing status for a specific purge operation. + public partial interface IComponentPurgeStatusResponse : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Status of the operation represented by the requested Id. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Status of the operation represented by the requested Id.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState Status { get; set; } + + } + /// Response containing status for a specific purge operation. + internal partial interface IComponentPurgeStatusResponseInternal + + { + /// Status of the operation represented by the requested Id. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState Status { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.json.cs new file mode 100644 index 000000000000..c414e822c0c2 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Response containing status for a specific purge operation. + public partial class ComponentPurgeStatusResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ComponentPurgeStatusResponse(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ComponentPurgeStatusResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.PowerShell.cs new file mode 100644 index 000000000000..46063034800e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An azure resource object + [System.ComponentModel.TypeConverter(typeof(ComponentsResourceTypeConverter))] + public partial class ComponentsResource + { + + /// + /// 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 ComponentsResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTagsTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ComponentsResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTagsTypeConverter.ConvertFrom); + } + 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.ApplicationInsights.Models.Api202002.IComponentsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ComponentsResource(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.ApplicationInsights.Models.Api202002.IComponentsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentsResource(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.ApplicationInsights.Models.Api202002.IComponentsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An azure resource object + [System.ComponentModel.TypeConverter(typeof(ComponentsResourceTypeConverter))] + public partial interface IComponentsResource + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.TypeConverter.cs new file mode 100644 index 000000000000..53ca8a1c4cac --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ComponentsResourceTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IComponentsResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ComponentsResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ComponentsResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ComponentsResource.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.cs new file mode 100644 index 000000000000..58dcae8d61a8 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.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.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An azure resource object + public partial class ComponentsResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal + { + + /// Backing field for property. + private string _id; + + /// Azure resource Id + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Backing field for property. + private string _location; + + /// Resource location + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// Azure resource name + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags _tag; + + /// Resource tags + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTags()); set => this._tag = value; } + + /// Backing field for property. + private string _type; + + /// Azure resource type + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ComponentsResource() + { + + } + } + /// An azure resource object + public partial interface IComponentsResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Azure resource Id + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure resource Id", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Resource location + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource location", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// Azure resource name + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure resource name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Resource tags + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags Tag { get; set; } + /// Azure resource type + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure resource type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// An azure resource object + internal partial interface IComponentsResourceInternal + + { + /// Azure resource Id + string Id { get; set; } + /// Resource location + string Location { get; set; } + /// Azure resource name + string Name { get; set; } + /// Resource tags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags Tag { get; set; } + /// Azure resource type + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.json.cs new file mode 100644 index 000000000000..647f2d38c229 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An azure resource object + public partial class ComponentsResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ComponentsResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ComponentsResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.PowerShell.cs new file mode 100644 index 000000000000..51d06393c283 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Resource tags + [System.ComponentModel.TypeConverter(typeof(ComponentsResourceTagsTypeConverter))] + public partial class ComponentsResourceTags + { + + /// + /// 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 ComponentsResourceTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ComponentsResourceTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + 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.ApplicationInsights.Models.Api202002.IComponentsResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ComponentsResourceTags(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.ApplicationInsights.Models.Api202002.IComponentsResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentsResourceTags(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.ApplicationInsights.Models.Api202002.IComponentsResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Resource tags + [System.ComponentModel.TypeConverter(typeof(ComponentsResourceTagsTypeConverter))] + public partial interface IComponentsResourceTags + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..febfab42234f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ComponentsResourceTagsTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IComponentsResourceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ComponentsResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ComponentsResourceTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ComponentsResourceTags.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.cs new file mode 100644 index 000000000000..fcc17b74aeb4 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Resource tags + public partial class ComponentsResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTagsInternal + { + + /// Creates an new instance. + public ComponentsResourceTags() + { + + } + } + /// Resource tags + public partial interface IComponentsResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray + { + + } + /// Resource tags + internal partial interface IComponentsResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.dictionary.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.dictionary.cs new file mode 100644 index 000000000000..c7c015806687 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + public partial class ComponentsResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.json.cs new file mode 100644 index 000000000000..f8fb9a1d4ae2 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Resource tags + public partial class ComponentsResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ComponentsResourceTags(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ComponentsResourceTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.PowerShell.cs new file mode 100644 index 000000000000..da3a9558238a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.PowerShell.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ErrorResponseComponentsTypeConverter))] + public partial class ErrorResponseComponents + { + + /// + /// 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.ApplicationInsights.Models.Api202002.IErrorResponseComponents DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponseComponents(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.ApplicationInsights.Models.Api202002.IErrorResponseComponents DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponseComponents(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponseComponents(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.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Message, 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 ErrorResponseComponents(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.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Message, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api202002.IErrorResponseComponents FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(ErrorResponseComponentsTypeConverter))] + public partial interface IErrorResponseComponents + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.TypeConverter.cs new file mode 100644 index 000000000000..efd48219d45c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorResponseComponentsTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IErrorResponseComponents ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorResponseComponents.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorResponseComponents.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorResponseComponents.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.cs new file mode 100644 index 000000000000..cb63b46d474a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + public partial class ErrorResponseComponents : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError _error; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsError()); set => this._error = value; } + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Code = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsError()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Message = value; } + + /// Creates an new instance. + public ErrorResponseComponents() + { + + } + } + public partial interface IErrorResponseComponents : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + + } + internal partial interface IErrorResponseComponentsInternal + + { + /// Error code. + string Code { get; set; } + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError Error { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.json.cs new file mode 100644 index 000000000000..18d6ea8ebe2e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.json.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + public partial class ErrorResponseComponents + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponseComponents(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Models.Api202002.ErrorResponseComponentsError.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ErrorResponseComponents(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.PowerShell.cs new file mode 100644 index 000000000000..1d089c46bef6 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + [System.ComponentModel.TypeConverter(typeof(ErrorResponseComponentsErrorTypeConverter))] + public partial class ErrorResponseComponentsError + { + + /// + /// 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.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponseComponentsError(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.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponseComponentsError(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponseComponentsError(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.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)this).Message, 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 ErrorResponseComponentsError(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.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)this).Message, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + [System.ComponentModel.TypeConverter(typeof(ErrorResponseComponentsErrorTypeConverter))] + public partial interface IErrorResponseComponentsError + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.TypeConverter.cs new file mode 100644 index 000000000000..7b17932458a8 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorResponseComponentsErrorTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorResponseComponentsError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorResponseComponentsError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorResponseComponentsError.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.cs new file mode 100644 index 000000000000..cd9a3a0a6d62 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + public partial class ErrorResponseComponentsError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal + { + + /// Backing field for property. + private string _code; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private string _message; + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal.Message { get => this._message; set { {_message = value;} } } + + /// Creates an new instance. + public ErrorResponseComponentsError() + { + + } + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + public partial interface IErrorResponseComponentsError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + internal partial interface IErrorResponseComponentsErrorInternal + + { + /// Error code. + string Code { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.json.cs new file mode 100644 index 000000000000..e1f1dfce6113 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + public partial class ErrorResponseComponentsError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponseComponentsError(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ErrorResponseComponentsError(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.PowerShell.cs new file mode 100644 index 000000000000..cb8e06411d4f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// The private link scope resource reference. + [System.ComponentModel.TypeConverter(typeof(PrivateLinkScopedResourceTypeConverter))] + public partial class PrivateLinkScopedResource + { + + /// + /// 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.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateLinkScopedResource(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.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateLinkScopedResource(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.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateLinkScopedResource(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.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResourceInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResourceInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResourceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResourceInternal)this).ScopeId, 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 PrivateLinkScopedResource(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.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResourceInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResourceInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResourceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResourceInternal)this).ScopeId, 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.ApplicationInsights.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 private link scope resource reference. + [System.ComponentModel.TypeConverter(typeof(PrivateLinkScopedResourceTypeConverter))] + public partial interface IPrivateLinkScopedResource + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.TypeConverter.cs new file mode 100644 index 000000000000..051cdde1fa89 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.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.ApplicationInsights.Models.Api202002 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateLinkScopedResourceTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateLinkScopedResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateLinkScopedResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateLinkScopedResource.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.cs new file mode 100644 index 000000000000..aa8977122555 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// The private link scope resource reference. + public partial class PrivateLinkScopedResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResourceInternal + { + + /// Backing field for property. + private string _resourceId; + + /// The full resource Id of the private link scope resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private string _scopeId; + + /// The private link scope unique Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ScopeId { get => this._scopeId; set => this._scopeId = value; } + + /// Creates an new instance. + public PrivateLinkScopedResource() + { + + } + } + /// The private link scope resource reference. + public partial interface IPrivateLinkScopedResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// The full resource Id of the private link scope resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full resource Id of the private link scope resource.", + SerializedName = @"ResourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// The private link scope unique Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The private link scope unique Identifier.", + SerializedName = @"ScopeId", + PossibleTypes = new [] { typeof(string) })] + string ScopeId { get; set; } + + } + /// The private link scope resource reference. + internal partial interface IPrivateLinkScopedResourceInternal + + { + /// The full resource Id of the private link scope resource. + string ResourceId { get; set; } + /// The private link scope unique Identifier. + string ScopeId { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.json.cs new file mode 100644 index 000000000000..e6609dd9e01b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.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.ApplicationInsights.Models.Api202002 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// The private link scope resource reference. + public partial class PrivateLinkScopedResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new PrivateLinkScopedResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkScopedResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("ResourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_scopeId = If( json?.PropertyT("ScopeId"), out var __jsonScopeId) ? (string)__jsonScopeId : (string)ScopeId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "ResourceId" ,container.Add ); + AddIf( null != (((object)this._scopeId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._scopeId.ToString()) : null, "ScopeId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.PowerShell.cs new file mode 100644 index 000000000000..7a9948aeb6b1 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.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.ApplicationInsights.Models.Api20200301Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component linked storage accounts + [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsTypeConverter))] + public partial class ComponentLinkedStorageAccounts + { + + /// + /// 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 ComponentLinkedStorageAccounts(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("LinkedStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount, 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 ComponentLinkedStorageAccounts(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("LinkedStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ComponentLinkedStorageAccounts(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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentLinkedStorageAccounts(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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component linked storage accounts + [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsTypeConverter))] + public partial interface IComponentLinkedStorageAccounts + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.TypeConverter.cs new file mode 100644 index 000000000000..9fb2eb5e16ad --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.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.ApplicationInsights.Models.Api20200301Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ComponentLinkedStorageAccountsTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ComponentLinkedStorageAccounts.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ComponentLinkedStorageAccounts.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ComponentLinkedStorageAccounts.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.cs new file mode 100644 index 000000000000..b4c08a5ab14d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.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.ApplicationInsights.Models.Api20200301Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component linked storage accounts + public partial class ComponentLinkedStorageAccounts : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id; } + + /// Linked storage account resource ID + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string LinkedStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)Property).LinkedStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)Property).LinkedStorageAccount = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties _property; + + /// The properties of the linked storage accounts. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties()); set => this._property = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ComponentLinkedStorageAccounts() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// An Application Insights component linked storage accounts + public partial interface IComponentLinkedStorageAccounts : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource + { + /// Linked storage account resource ID + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Linked storage account resource ID", + SerializedName = @"linkedStorageAccount", + PossibleTypes = new [] { typeof(string) })] + string LinkedStorageAccount { get; set; } + + } + /// An Application Insights component linked storage accounts + internal partial interface IComponentLinkedStorageAccountsInternal : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal + { + /// Linked storage account resource ID + string LinkedStorageAccount { get; set; } + /// The properties of the linked storage accounts. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.json.cs new file mode 100644 index 000000000000..618255928dd3 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.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.ApplicationInsights.Models.Api20200301Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component linked storage accounts + public partial class ComponentLinkedStorageAccounts + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ComponentLinkedStorageAccounts(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ComponentLinkedStorageAccounts(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.PowerShell.cs new file mode 100644 index 000000000000..ad77a8f06db0 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.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.ApplicationInsights.Models.Api20200301Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component linked storage accounts patch + [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsPatchTypeConverter))] + public partial class ComponentLinkedStorageAccountsPatch + { + + /// + /// 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 ComponentLinkedStorageAccountsPatch(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LinkedStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount, 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 ComponentLinkedStorageAccountsPatch(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LinkedStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ComponentLinkedStorageAccountsPatch(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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentLinkedStorageAccountsPatch(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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// An Application Insights component linked storage accounts patch + [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsPatchTypeConverter))] + public partial interface IComponentLinkedStorageAccountsPatch + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.TypeConverter.cs new file mode 100644 index 000000000000..15ebee187988 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.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.ApplicationInsights.Models.Api20200301Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ComponentLinkedStorageAccountsPatchTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ComponentLinkedStorageAccountsPatch.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ComponentLinkedStorageAccountsPatch.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ComponentLinkedStorageAccountsPatch.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.cs new file mode 100644 index 000000000000..e497575ea07b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component linked storage accounts patch + public partial class ComponentLinkedStorageAccountsPatch : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal + { + + /// Linked storage account resource ID + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string LinkedStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)Property).LinkedStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)Property).LinkedStorageAccount = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties _property; + + /// The properties of the linked storage accounts. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties()); set => this._property = value; } + + /// Creates an new instance. + public ComponentLinkedStorageAccountsPatch() + { + + } + } + /// An Application Insights component linked storage accounts patch + public partial interface IComponentLinkedStorageAccountsPatch : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Linked storage account resource ID + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Linked storage account resource ID", + SerializedName = @"linkedStorageAccount", + PossibleTypes = new [] { typeof(string) })] + string LinkedStorageAccount { get; set; } + + } + /// An Application Insights component linked storage accounts patch + internal partial interface IComponentLinkedStorageAccountsPatchInternal + + { + /// Linked storage account resource ID + string LinkedStorageAccount { get; set; } + /// The properties of the linked storage accounts. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.json.cs new file mode 100644 index 000000000000..c000dcb3cfef --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component linked storage accounts patch + public partial class ComponentLinkedStorageAccountsPatch + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ComponentLinkedStorageAccountsPatch(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ComponentLinkedStorageAccountsPatch(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.PowerShell.cs new file mode 100644 index 000000000000..cdc93aab5b17 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.PowerShell.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ErrorResponseLinkedStorageTypeConverter))] + public partial class ErrorResponseLinkedStorage + { + + /// + /// 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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponseLinkedStorage(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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponseLinkedStorage(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponseLinkedStorage(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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Message, 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 ErrorResponseLinkedStorage(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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Message, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(ErrorResponseLinkedStorageTypeConverter))] + public partial interface IErrorResponseLinkedStorage + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.TypeConverter.cs new file mode 100644 index 000000000000..f675a193edd6 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.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.ApplicationInsights.Models.Api20200301Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorResponseLinkedStorageTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorResponseLinkedStorage.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorResponseLinkedStorage.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorResponseLinkedStorage.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.cs new file mode 100644 index 000000000000..552ea2d81103 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + public partial class ErrorResponseLinkedStorage : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError _error; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageError()); set => this._error = value; } + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Code = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageError()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Message = value; } + + /// Creates an new instance. + public ErrorResponseLinkedStorage() + { + + } + } + public partial interface IErrorResponseLinkedStorage : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + + } + internal partial interface IErrorResponseLinkedStorageInternal + + { + /// Error code. + string Code { get; set; } + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError Error { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.json.cs new file mode 100644 index 000000000000..b4a08523b9af --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.json.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + public partial class ErrorResponseLinkedStorage + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponseLinkedStorage(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageError.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ErrorResponseLinkedStorage(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.PowerShell.cs new file mode 100644 index 000000000000..2a90b3b2f50e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + [System.ComponentModel.TypeConverter(typeof(ErrorResponseLinkedStorageErrorTypeConverter))] + public partial class ErrorResponseLinkedStorageError + { + + /// + /// 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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponseLinkedStorageError(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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponseLinkedStorageError(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponseLinkedStorageError(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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)this).Message, 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 ErrorResponseLinkedStorageError(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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)this).Message, global::System.Convert.ToString); + } + 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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.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(); + } + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + [System.ComponentModel.TypeConverter(typeof(ErrorResponseLinkedStorageErrorTypeConverter))] + public partial interface IErrorResponseLinkedStorageError + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.TypeConverter.cs new file mode 100644 index 000000000000..f55ba13e2514 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.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.ApplicationInsights.Models.Api20200301Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorResponseLinkedStorageErrorTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorResponseLinkedStorageError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorResponseLinkedStorageError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorResponseLinkedStorageError.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.cs new file mode 100644 index 000000000000..d2e3fc026f2e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + public partial class ErrorResponseLinkedStorageError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal + { + + /// Backing field for property. + private string _code; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private string _message; + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal.Message { get => this._message; set { {_message = value;} } } + + /// Creates an new instance. + public ErrorResponseLinkedStorageError() + { + + } + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + public partial interface IErrorResponseLinkedStorageError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + internal partial interface IErrorResponseLinkedStorageErrorInternal + + { + /// Error code. + string Code { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.json.cs new file mode 100644 index 000000000000..4a1e29ce8cea --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + public partial class ErrorResponseLinkedStorageError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponseLinkedStorageError(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ErrorResponseLinkedStorageError(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.PowerShell.cs new file mode 100644 index 000000000000..72c5ce28cddc --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.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.ApplicationInsights.Models.Api20200301Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component linked storage account + [System.ComponentModel.TypeConverter(typeof(LinkedStorageAccountsPropertiesTypeConverter))] + public partial class LinkedStorageAccountsProperties + { + + /// + /// 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.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LinkedStorageAccountsProperties(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.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LinkedStorageAccountsProperties(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.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LinkedStorageAccountsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LinkedStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)this).LinkedStorageAccount, 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 LinkedStorageAccountsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LinkedStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)this).LinkedStorageAccount, 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.ApplicationInsights.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(); + } + } + /// An Application Insights component linked storage account + [System.ComponentModel.TypeConverter(typeof(LinkedStorageAccountsPropertiesTypeConverter))] + public partial interface ILinkedStorageAccountsProperties + + { + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.TypeConverter.cs new file mode 100644 index 000000000000..1b8a10b427b0 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.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.ApplicationInsights.Models.Api20200301Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LinkedStorageAccountsPropertiesTypeConverter : 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 . + /// + /// 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.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 to the parameter using and + /// + /// 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.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LinkedStorageAccountsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LinkedStorageAccountsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LinkedStorageAccountsProperties.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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.cs new file mode 100644 index 000000000000..d7e196077e23 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component linked storage account + public partial class LinkedStorageAccountsProperties : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal + { + + /// Backing field for property. + private string _linkedStorageAccount; + + /// Linked storage account resource ID + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string LinkedStorageAccount { get => this._linkedStorageAccount; set => this._linkedStorageAccount = value; } + + /// Creates an new instance. + public LinkedStorageAccountsProperties() + { + + } + } + /// An Application Insights component linked storage account + public partial interface ILinkedStorageAccountsProperties : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Linked storage account resource ID + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Linked storage account resource ID", + SerializedName = @"linkedStorageAccount", + PossibleTypes = new [] { typeof(string) })] + string LinkedStorageAccount { get; set; } + + } + /// An Application Insights component linked storage account + internal partial interface ILinkedStorageAccountsPropertiesInternal + + { + /// Linked storage account resource ID + string LinkedStorageAccount { get; set; } + + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.json.cs new file mode 100644 index 000000000000..c8f35bc5828b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.json.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An Application Insights component linked storage account + public partial class LinkedStorageAccountsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new LinkedStorageAccountsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal LinkedStorageAccountsProperties(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_linkedStorageAccount = If( json?.PropertyT("linkedStorageAccount"), out var __jsonLinkedStorageAccount) ? (string)__jsonLinkedStorageAccount : (string)LinkedStorageAccount;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._linkedStorageAccount)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._linkedStorageAccount.ToString()) : null, "linkedStorageAccount" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.PowerShell.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.PowerShell.cs index 66639ae8c3ad..2e5c1156555b 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.PowerShell.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.PowerShell.cs @@ -89,6 +89,30 @@ internal ApplicationInsightsIdentity(global::System.Collections.IDictionary cont { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ComponentName = (string) content.GetValueForProperty("ComponentName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ComponentName, global::System.Convert.ToString); } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("PurgeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).PurgeId = (string) content.GetValueForProperty("PurgeId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).PurgeId, global::System.Convert.ToString); + } + if (content.Contains("KeyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).KeyId = (string) content.GetValueForProperty("KeyId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).KeyId, global::System.Convert.ToString); + } + if (content.Contains("AnnotationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).AnnotationId = (string) content.GetValueForProperty("AnnotationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).AnnotationId, global::System.Convert.ToString); + } + if (content.Contains("ExportId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ExportId = (string) content.GetValueForProperty("ExportId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ExportId, global::System.Convert.ToString); + } + if (content.Contains("StorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).StorageType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType?) content.GetValueForProperty("StorageType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).StorageType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType.CreateFrom); + } if (content.Contains("Id")) { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).Id, global::System.Convert.ToString); @@ -126,6 +150,30 @@ internal ApplicationInsightsIdentity(global::System.Management.Automation.PSObje { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ComponentName = (string) content.GetValueForProperty("ComponentName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ComponentName, global::System.Convert.ToString); } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("PurgeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).PurgeId = (string) content.GetValueForProperty("PurgeId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).PurgeId, global::System.Convert.ToString); + } + if (content.Contains("KeyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).KeyId = (string) content.GetValueForProperty("KeyId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).KeyId, global::System.Convert.ToString); + } + if (content.Contains("AnnotationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).AnnotationId = (string) content.GetValueForProperty("AnnotationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).AnnotationId, global::System.Convert.ToString); + } + if (content.Contains("ExportId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ExportId = (string) content.GetValueForProperty("ExportId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ExportId, global::System.Convert.ToString); + } + if (content.Contains("StorageType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).StorageType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType?) content.GetValueForProperty("StorageType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).StorageType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType.CreateFrom); + } if (content.Contains("Id")) { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).Id, global::System.Convert.ToString); @@ -165,7 +213,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApp /// 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. + /// an instance of the model class. public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.TypeConverter.cs index e68e66b1985a..cee4550fe137 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.TypeConverter.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.TypeConverter.cs @@ -26,8 +26,8 @@ public partial class ApplicationInsightsIdentityTypeConverter : global::System.M public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the - /// parameter. + /// Determines if the converter can convert the parameter to the . /// /// the instance to check if it can be converted to the type. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.cs index 4ed7a316af99..19c7b0144549 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.cs @@ -12,6 +12,15 @@ public partial class ApplicationInsightsIdentity : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal { + /// Backing field for property. + private string _annotationId; + + /// + /// The unique annotation ID. This is unique within a Application Insights component. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string AnnotationId { get => this._annotationId; set => this._annotationId = value; } + /// Backing field for property. private string _componentName; @@ -19,6 +28,15 @@ public partial class ApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] public string ComponentName { get => this._componentName; set => this._componentName = value; } + /// Backing field for property. + private string _exportId; + + /// + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ExportId { get => this._exportId; set => this._exportId = value; } + /// Backing field for property. private string _id; @@ -26,6 +44,22 @@ public partial class ApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] public string Id { get => this._id; set => this._id = value; } + /// Backing field for property. + private string _keyId; + + /// The API Key ID. This is unique within a Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string KeyId { get => this._keyId; set => this._keyId = value; } + + /// Backing field for property. + private string _purgeId; + + /// + /// In a purge status request, this is the Id of the operation the status of which is returned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string PurgeId { get => this._purgeId; set => this._purgeId = value; } + /// Backing field for property. private string _resourceGroupName; @@ -33,6 +67,22 @@ public partial class ApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + /// Backing field for property. + private string _resourceName; + + /// The name of the Application Insights component resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType? _storageType; + + /// + /// The type of the Application Insights component data source for the linked storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType? StorageType { get => this._storageType; set => this._storageType = value; } + /// Backing field for property. private string _subscriptionId; @@ -56,6 +106,16 @@ public ApplicationInsightsIdentity() public partial interface IApplicationInsightsIdentity : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable { + /// + /// The unique annotation ID. This is unique within a Application Insights component. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique annotation ID. This is unique within a Application Insights component.", + SerializedName = @"annotationId", + PossibleTypes = new [] { typeof(string) })] + string AnnotationId { get; set; } /// The name of the Application Insights component resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, @@ -64,6 +124,16 @@ public partial interface IApplicationInsightsIdentity : SerializedName = @"componentName", PossibleTypes = new [] { typeof(string) })] string ComponentName { get; set; } + /// + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Continuous Export configuration ID. This is unique within a Application Insights component.", + SerializedName = @"exportId", + PossibleTypes = new [] { typeof(string) })] + string ExportId { get; set; } /// Resource identity path [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, @@ -72,6 +142,24 @@ public partial interface IApplicationInsightsIdentity : SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] string Id { get; set; } + /// The API Key ID. This is unique within a Application Insights component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The API Key ID. This is unique within a Application Insights component.", + SerializedName = @"keyId", + PossibleTypes = new [] { typeof(string) })] + string KeyId { get; set; } + /// + /// In a purge status request, this is the Id of the operation the status of which is returned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"In a purge status request, this is the Id of the operation the status of which is returned.", + SerializedName = @"purgeId", + PossibleTypes = new [] { typeof(string) })] + string PurgeId { get; set; } /// The name of the resource group. The name is case insensitive. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, @@ -80,6 +168,24 @@ public partial interface IApplicationInsightsIdentity : SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] string ResourceGroupName { get; set; } + /// The name of the Application Insights component resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + string ResourceName { get; set; } + /// + /// The type of the Application Insights component data source for the linked storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the Application Insights component data source for the linked storage account.", + SerializedName = @"storageType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType? StorageType { get; set; } /// The ID of the target subscription. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, @@ -101,12 +207,32 @@ public partial interface IApplicationInsightsIdentity : internal partial interface IApplicationInsightsIdentityInternal { + /// + /// The unique annotation ID. This is unique within a Application Insights component. + /// + string AnnotationId { get; set; } /// The name of the Application Insights component resource. string ComponentName { get; set; } + /// + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// + string ExportId { get; set; } /// Resource identity path string Id { get; set; } + /// The API Key ID. This is unique within a Application Insights component. + string KeyId { get; set; } + /// + /// In a purge status request, this is the Id of the operation the status of which is returned. + /// + string PurgeId { get; set; } /// The name of the resource group. The name is case insensitive. string ResourceGroupName { get; set; } + /// The name of the Application Insights component resource. + string ResourceName { get; set; } + /// + /// The type of the Application Insights component data source for the linked storage account. + /// + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType? StorageType { get; set; } /// The ID of the target subscription. string SubscriptionId { get; set; } /// The name of the Application Insights WebTest resource. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.json.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.json.cs index dbbe15830c02..be5eb35be878 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.json.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.json.cs @@ -66,6 +66,12 @@ internal ApplicationInsightsIdentity(Microsoft.Azure.PowerShell.Cmdlets.Applicat {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} {_webTestName = If( json?.PropertyT("webTestName"), out var __jsonWebTestName) ? (string)__jsonWebTestName : (string)WebTestName;} {_componentName = If( json?.PropertyT("componentName"), out var __jsonComponentName) ? (string)__jsonComponentName : (string)ComponentName;} + {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName;} + {_purgeId = If( json?.PropertyT("purgeId"), out var __jsonPurgeId) ? (string)__jsonPurgeId : (string)PurgeId;} + {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)KeyId;} + {_annotationId = If( json?.PropertyT("annotationId"), out var __jsonAnnotationId) ? (string)__jsonAnnotationId : (string)AnnotationId;} + {_exportId = If( json?.PropertyT("exportId"), out var __jsonExportId) ? (string)__jsonExportId : (string)ExportId;} + {_storageType = If( json?.PropertyT("storageType"), out var __jsonStorageType) ? (string)__jsonStorageType : (string)StorageType;} {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} AfterFromJson(json); } @@ -105,6 +111,12 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); AddIf( null != (((object)this._webTestName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._webTestName.ToString()) : null, "webTestName" ,container.Add ); AddIf( null != (((object)this._componentName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._componentName.ToString()) : null, "componentName" ,container.Add ); + AddIf( null != (((object)this._resourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._resourceName.ToString()) : null, "resourceName" ,container.Add ); + AddIf( null != (((object)this._purgeId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._purgeId.ToString()) : null, "purgeId" ,container.Add ); + AddIf( null != (((object)this._keyId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._keyId.ToString()) : null, "keyId" ,container.Add ); + AddIf( null != (((object)this._annotationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._annotationId.ToString()) : null, "annotationId" ,container.Add ); + AddIf( null != (((object)this._exportId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._exportId.ToString()) : null, "exportId" ,container.Add ); + AddIf( null != (((object)this._storageType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._storageType.ToString()) : null, "storageType" ,container.Add ); AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); AfterToJson(ref container); return container; diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.Completer.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.Completer.cs new file mode 100644 index 000000000000..9180a803adcc --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// Type of application being monitored. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationTypeTypeConverter))] + public partial struct ApplicationType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "web".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'web'", "web", global::System.Management.Automation.CompletionResultType.ParameterValue, "web"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "other".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'other'", "other", global::System.Management.Automation.CompletionResultType.ParameterValue, "other"); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.TypeConverter.cs new file mode 100644 index 000000000000..f2fcf01c04b0 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// Type of application being monitored. + public partial class ApplicationTypeTypeConverter : + 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) => true; + + /// + /// 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 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) => ApplicationType.CreateFrom(sourceValue); + + /// 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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.cs new file mode 100644 index 000000000000..93fa900c81d4 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// Type of application being monitored. + public partial struct ApplicationType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType Other = @"other"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType Web = @"web"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private ApplicationType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ApplicationType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ApplicationType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ApplicationType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ApplicationType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ApplicationType && Equals((ApplicationType)obj); + } + + /// Returns hashCode for enum ApplicationType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ApplicationType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ApplicationType + /// the value to convert to an instance of . + + public static implicit operator ApplicationType(string value) + { + return new ApplicationType(value); + } + + /// Implicit operator to convert ApplicationType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType e) + { + return e._value; + } + + /// Overriding != operator for enum ApplicationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ApplicationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.Completer.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.Completer.cs new file mode 100644 index 000000000000..2e254b6d1433 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.Completer.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowTypeTypeConverter))] + public partial struct FlowType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Bluefield".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Bluefield'", "Bluefield", global::System.Management.Automation.CompletionResultType.ParameterValue, "Bluefield"); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.TypeConverter.cs new file mode 100644 index 000000000000..ca76bc05e799 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + public partial class FlowTypeTypeConverter : + 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) => true; + + /// + /// 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 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) => FlowType.CreateFrom(sourceValue); + + /// 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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.cs new file mode 100644 index 000000000000..9bed459ed004 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + public partial struct FlowType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType Bluefield = @"Bluefield"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to FlowType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new FlowType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type FlowType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type FlowType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is FlowType && Equals((FlowType)obj); + } + + /// Creates an instance of the + /// the value to create an instance for. + private FlowType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum FlowType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for FlowType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to FlowType + /// the value to convert to an instance of . + + public static implicit operator FlowType(string value) + { + return new FlowType(value); + } + + /// Implicit operator to convert FlowType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType e) + { + return e._value; + } + + /// Overriding != operator for enum FlowType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum FlowType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.Completer.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.Completer.cs new file mode 100644 index 000000000000..f633df2e6d5e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// Indicates the flow of the ingestion. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionModeTypeConverter))] + public partial struct IngestionMode : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ApplicationInsights".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ApplicationInsights'", "ApplicationInsights", global::System.Management.Automation.CompletionResultType.ParameterValue, "ApplicationInsights"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ApplicationInsightsWithDiagnosticSettings".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ApplicationInsightsWithDiagnosticSettings'", "ApplicationInsightsWithDiagnosticSettings", global::System.Management.Automation.CompletionResultType.ParameterValue, "ApplicationInsightsWithDiagnosticSettings"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "LogAnalytics".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'LogAnalytics'", "LogAnalytics", global::System.Management.Automation.CompletionResultType.ParameterValue, "LogAnalytics"); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.TypeConverter.cs new file mode 100644 index 000000000000..de2164cf1a26 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// Indicates the flow of the ingestion. + public partial class IngestionModeTypeConverter : + 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) => true; + + /// + /// 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 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) => IngestionMode.CreateFrom(sourceValue); + + /// 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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.cs new file mode 100644 index 000000000000..b02b18161672 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.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.ApplicationInsights.Support +{ + + /// Indicates the flow of the ingestion. + public partial struct IngestionMode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode ApplicationInsights = @"ApplicationInsights"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode ApplicationInsightsWithDiagnosticSettings = @"ApplicationInsightsWithDiagnosticSettings"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode LogAnalytics = @"LogAnalytics"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IngestionMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IngestionMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IngestionMode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IngestionMode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is IngestionMode && Equals((IngestionMode)obj); + } + + /// Returns hashCode for enum IngestionMode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private IngestionMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IngestionMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IngestionMode + /// the value to convert to an instance of . + + public static implicit operator IngestionMode(string value) + { + return new IngestionMode(value); + } + + /// Implicit operator to convert IngestionMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode e) + { + return e._value; + } + + /// Overriding != operator for enum IngestionMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IngestionMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.Completer.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.Completer.cs new file mode 100644 index 000000000000..f0185308614e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// + /// The network access type for operating on the Application Insights Component. By default it is Enabled + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessTypeTypeConverter))] + public partial struct PublicNetworkAccessType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.TypeConverter.cs new file mode 100644 index 000000000000..38ae17d78814 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// + /// The network access type for operating on the Application Insights Component. By default it is Enabled + /// + public partial class PublicNetworkAccessTypeTypeConverter : + 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) => true; + + /// + /// 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 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) => PublicNetworkAccessType.CreateFrom(sourceValue); + + /// 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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.cs new file mode 100644 index 000000000000..c0f0bc06b864 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// + /// The network access type for operating on the Application Insights Component. By default it is Enabled + /// + public partial struct PublicNetworkAccessType : + System.IEquatable + { + /// Disables public connectivity to Application Insights through public DNS. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType Disabled = @"Disabled"; + + /// Enables connectivity to Application Insights through public DNS. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PublicNetworkAccessType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PublicNetworkAccessType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PublicNetworkAccessType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PublicNetworkAccessType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PublicNetworkAccessType && Equals((PublicNetworkAccessType)obj); + } + + /// Returns hashCode for enum PublicNetworkAccessType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private PublicNetworkAccessType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PublicNetworkAccessType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PublicNetworkAccessType + /// the value to convert to an instance of . + + public static implicit operator PublicNetworkAccessType(string value) + { + return new PublicNetworkAccessType(value); + } + + /// Implicit operator to convert PublicNetworkAccessType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType e) + { + return e._value; + } + + /// Overriding != operator for enum PublicNetworkAccessType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PublicNetworkAccessType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.Completer.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.Completer.cs new file mode 100644 index 000000000000..247312f0d43a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// Status of the operation represented by the requested Id. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeStateTypeConverter))] + public partial struct PurgeState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'pending'", "pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "pending"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'completed'", "completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "completed"); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.TypeConverter.cs new file mode 100644 index 000000000000..957622a26f3a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// Status of the operation represented by the requested Id. + public partial class PurgeStateTypeConverter : + 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) => true; + + /// + /// 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 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) => PurgeState.CreateFrom(sourceValue); + + /// 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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.cs new file mode 100644 index 000000000000..abeea65e0a70 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// Status of the operation represented by the requested Id. + public partial struct PurgeState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState Completed = @"completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState Pending = @"pending"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PurgeState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PurgeState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PurgeState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PurgeState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PurgeState && Equals((PurgeState)obj); + } + + /// Returns hashCode for enum PurgeState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private PurgeState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PurgeState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PurgeState + /// the value to convert to an instance of . + + public static implicit operator PurgeState(string value) + { + return new PurgeState(value); + } + + /// Implicit operator to convert PurgeState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState e) + { + return e._value; + } + + /// Overriding != operator for enum PurgeState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PurgeState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.Completer.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.Completer.cs new file mode 100644 index 000000000000..320704e07db9 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.Completer.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// + /// Describes what tool created this Application Insights component. Customers using this API should set this to the default + /// 'rest'. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSourceTypeConverter))] + public partial struct RequestSource : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "rest".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'rest'", "rest", global::System.Management.Automation.CompletionResultType.ParameterValue, "rest"); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.TypeConverter.cs new file mode 100644 index 000000000000..8fe9687ee269 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// + /// Describes what tool created this Application Insights component. Customers using this API should set this to the default + /// 'rest'. + /// + public partial class RequestSourceTypeConverter : + 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) => true; + + /// + /// 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 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) => RequestSource.CreateFrom(sourceValue); + + /// 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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.cs new file mode 100644 index 000000000000..8be5e3bb5885 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// + /// Describes what tool created this Application Insights component. Customers using this API should set this to the default + /// 'rest'. + /// + public partial struct RequestSource : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource Rest = @"rest"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RequestSource + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RequestSource(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RequestSource + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RequestSource (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RequestSource && Equals((RequestSource)obj); + } + + /// Returns hashCode for enum RequestSource + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RequestSource(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RequestSource + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RequestSource + /// the value to convert to an instance of . + + public static implicit operator RequestSource(string value) + { + return new RequestSource(value); + } + + /// Implicit operator to convert RequestSource to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource e) + { + return e._value; + } + + /// Overriding != operator for enum RequestSource + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RequestSource + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.Completer.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.Completer.cs new file mode 100644 index 000000000000..cb34008f7c13 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// Argument completer implementation for StorageType. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageTypeTypeConverter))] + public partial struct StorageType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ServiceProfiler".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ServiceProfiler'", "ServiceProfiler", global::System.Management.Automation.CompletionResultType.ParameterValue, "ServiceProfiler"); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.TypeConverter.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.TypeConverter.cs new file mode 100644 index 000000000000..79723b5c3fa5 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + /// TypeConverter implementation for StorageType. + public partial class StorageTypeTypeConverter : + 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) => true; + + /// + /// 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 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) => StorageType.CreateFrom(sourceValue); + + /// 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/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.cs new file mode 100644 index 000000000000..deb017d48558 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support +{ + + public partial struct StorageType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType ServiceProfiler = @"ServiceProfiler"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to StorageType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new StorageType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type StorageType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type StorageType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is StorageType && Equals((StorageType)obj); + } + + /// Returns hashCode for enum StorageType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private StorageType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for StorageType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to StorageType + /// the value to convert to an instance of . + + public static implicit operator StorageType(string value) + { + return new StorageType(value); + } + + /// Implicit operator to convert StorageType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType e) + { + return e._value; + } + + /// Overriding != operator for enum StorageType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum StorageType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_Purge.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_Purge.cs new file mode 100644 index 000000000000..6dd95f9e64a8 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_Purge.cs @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, + /// purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single + /// command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. + /// You should run the query prior to using for a purge request to verify that the results are expected. + /// + /// + /// [OpenAPI] Purge=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzApplicationInsights_Purge", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class ClearAzApplicationInsights_Purge : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody _body; + + /// Describes the body of a purge request for an App Insights component + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Describes the body of a purge request for an App Insights component", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Describes the body of a purge request for an App Insights component", + SerializedName = @"body", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody Body { get => this._body; set => this._body = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnAccepted will be called before the regular onAccepted 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 from the remote call + /// /// Determines if the rest of the onAccepted method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, 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 + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzApplicationInsights_Purge() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentsPurge' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsPurge(ResourceGroupName, SubscriptionId, Name, Body, onAccepted, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=Body}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 202 (Accepted). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnAccepted(responseMessage, response, ref _returnNow); + // if overrideOnAccepted has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onAccepted - response for 202 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + WriteObject((await response).OperationId); + } + } + + /// + /// 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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=Body }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=Body }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeExpanded.cs new file mode 100644 index 000000000000..d71531ea0bbb --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeExpanded.cs @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, + /// purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single + /// command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. + /// You should run the query prior to using for a purge request to verify that the results are expected. + /// + /// + /// [OpenAPI] Purge=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzApplicationInsights_PurgeExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class ClearAzApplicationInsights_PurgeExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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; + + /// Describes the body of a purge request for an App Insights component + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody _body = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBody(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The set of columns and filters (queries) to run over them to purge the resulting data. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The set of columns and filters (queries) to run over them to purge the resulting data.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The set of columns and filters (queries) to run over them to purge the resulting data.", + SerializedName = @"filters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters[] Filter { get => _body.Filter ?? null /* arrayOf */; set => _body.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Table from which to purge data. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Table from which to purge data.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Table from which to purge data.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + public string Table { get => _body.Table ?? null; set => _body.Table = value; } + + /// + /// overrideOnAccepted will be called before the regular onAccepted 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 from the remote call + /// /// Determines if the rest of the onAccepted method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, 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 + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzApplicationInsights_PurgeExpanded() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentsPurge' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsPurge(ResourceGroupName, SubscriptionId, Name, _body, onAccepted, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_body}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 202 (Accepted). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnAccepted(responseMessage, response, ref _returnNow); + // if overrideOnAccepted has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onAccepted - response for 202 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + WriteObject((await response).OperationId); + } + } + + /// + /// 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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_body }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_body }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentity.cs new file mode 100644 index 000000000000..58958996c999 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentity.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, + /// purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single + /// command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. + /// You should run the query prior to using for a purge request to verify that the results are expected. + /// + /// + /// [OpenAPI] Purge=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzApplicationInsights_PurgeViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class ClearAzApplicationInsights_PurgeViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody _body; + + /// Describes the body of a purge request for an App Insights component + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Describes the body of a purge request for an App Insights component", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Describes the body of a purge request for an App Insights component", + SerializedName = @"body", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody Body { get => this._body; set => this._body = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnAccepted will be called before the regular onAccepted 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 from the remote call + /// /// Determines if the rest of the onAccepted method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, 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 + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzApplicationInsights_PurgeViaIdentity() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentsPurge' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentsPurgeViaIdentity(InputObject.Id, Body, onAccepted, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentsPurge(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, Body, onAccepted, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 202 (Accepted). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnAccepted(responseMessage, response, ref _returnNow); + // if overrideOnAccepted has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onAccepted - response for 202 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + WriteObject((await response).OperationId); + } + } + + /// + /// 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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + { + 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 { body=Body }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentityExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentityExpanded.cs new file mode 100644 index 000000000000..e2ebdda8cb72 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentityExpanded.cs @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, + /// purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single + /// command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. + /// You should run the query prior to using for a purge request to verify that the results are expected. + /// + /// + /// [OpenAPI] Purge=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzApplicationInsights_PurgeViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class ClearAzApplicationInsights_PurgeViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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; + + /// Describes the body of a purge request for an App Insights component + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody _body = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBody(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The set of columns and filters (queries) to run over them to purge the resulting data. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The set of columns and filters (queries) to run over them to purge the resulting data.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The set of columns and filters (queries) to run over them to purge the resulting data.", + SerializedName = @"filters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters[] Filter { get => _body.Filter ?? null /* arrayOf */; set => _body.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Table from which to purge data. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Table from which to purge data.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Table from which to purge data.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + public string Table { get => _body.Table ?? null; set => _body.Table = value; } + + /// + /// overrideOnAccepted will be called before the regular onAccepted 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 from the remote call + /// /// Determines if the rest of the onAccepted method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, 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 + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzApplicationInsights_PurgeViaIdentityExpanded() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentsPurge' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentsPurgeViaIdentity(InputObject.Id, _body, onAccepted, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentsPurge(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, _body, onAccepted, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 202 (Accepted). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnAccepted(responseMessage, response, ref _returnNow); + // if overrideOnAccepted has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onAccepted - response for 202 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + WriteObject((await response).OperationId); + } + } + + /// + /// 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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + { + 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 { body=_body }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_Get.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_Get.cs new file mode 100644 index 000000000000..4299b527dc99 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_Get.cs @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Get the annotation for given id. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsAnnotation_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the annotation for given id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsAnnotation_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _id; + + /// + /// The unique annotation ID. This is unique within a Application Insights component. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The unique annotation ID. This is unique within a Application Insights component.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The unique annotation ID. This is unique within a Application Insights component.", + SerializedName = @"annotationId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AnnotationId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Id { get => this._id; set => this._id = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsAnnotation_Get() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AnnotationsGet(ResourceGroupName, SubscriptionId, ResourceName, Id, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,ResourceName=ResourceName,Id=Id}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, ResourceName=ResourceName, Id=Id }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, ResourceName=ResourceName, Id=Id }) + { + 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 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 + // response should be returning an array of some kind. +Pageable + // array / / + WriteObject(await response, true); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_GetViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_GetViaIdentity.cs new file mode 100644 index 000000000000..536cb411ec95 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_GetViaIdentity.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Get the annotation for given id. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsAnnotation_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the annotation for given id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsAnnotation_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsAnnotation_GetViaIdentity() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AnnotationsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AnnotationId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AnnotationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AnnotationsGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, InputObject.AnnotationId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.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 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 + // response should be returning an array of some kind. +Pageable + // array / / + WriteObject(await response, true); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_List.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_List.cs new file mode 100644 index 000000000000..fa86ec1a4ff3 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_List.cs @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Gets the list of annotations for a component for given time range + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsAnnotation_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Gets the list of annotations for a component for given time range")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsAnnotation_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _end; + + /// The end time to query for annotations. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The end time to query for annotations.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The end time to query for annotations.", + SerializedName = @"end", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] + public string End { get => this._end; set => this._end = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _start; + + /// + /// The start time to query from for annotations, cannot be older than 90 days from current date. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The start time to query from for annotations, cannot be older than 90 days from current date.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start time to query from for annotations, cannot be older than 90 days from current date.", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] + public string Start { get => this._start; set => this._start = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsAnnotation_List() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AnnotationsList(ResourceGroupName, SubscriptionId, ResourceName, Start, End, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,ResourceName=ResourceName,Start=Start,End=End}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, ResourceName=ResourceName, Start=Start, End=End }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, ResourceName=ResourceName, Start=Start, End=End }) + { + 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 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 + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_Get.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_Get.cs new file mode 100644 index 000000000000..3f4fd6606179 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_Get.cs @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Get the API Key for this key id. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsApiKey_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the API Key for this key id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsApiKey_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _apiKeyId; + + /// The API Key ID. This is unique within a Application Insights component. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The API Key ID. This is unique within a Application Insights component.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The API Key ID. This is unique within a Application Insights component.", + SerializedName = @"keyId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ApiKeyId { get => this._apiKeyId; set => this._apiKeyId = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsApiKey_Get() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApiKeysGet(ResourceGroupName, SubscriptionId, Name, ApiKeyId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,ApiKeyId=ApiKeyId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_GetViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_GetViaIdentity.cs new file mode 100644 index 000000000000..3523c586968b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_GetViaIdentity.cs @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Get the API Key for this key id. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsApiKey_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the API Key for this key id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsApiKey_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsApiKey_GetViaIdentity() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ApiKeysGetViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.KeyId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.KeyId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ApiKeysGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, InputObject.KeyId ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_List.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_List.cs new file mode 100644 index 000000000000..b6f33e50e6f1 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_List.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Gets a list of API keys of an Application Insights component. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsApiKey_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Gets a list of API keys of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsApiKey_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsApiKey_List() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApiKeysList(ResourceGroupName, SubscriptionId, Name, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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 + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_Get.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_Get.cs new file mode 100644 index 000000000000..caff95b7333c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_Get.cs @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Returns all available features of the application insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/getavailablebillingfeatures" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsComponentAvailableFeature_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns all available features of the application insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsComponentAvailableFeature_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsComponentAvailableFeature_Get() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentAvailableFeaturesGet(ResourceGroupName, SubscriptionId, Name, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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 + // response should be returning an array of some kind. +Pageable + // nested-array / Result / + WriteObject((await response).Result, true); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity.cs new file mode 100644 index 000000000000..883885cf0c7a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity.cs @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Returns all available features of the application insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/getavailablebillingfeatures" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsComponentAvailableFeature_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns all available features of the application insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentAvailableFeaturesGetViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentAvailableFeaturesGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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 + // response should be returning an array of some kind. +Pageable + // nested-array / Result / + WriteObject((await response).Result, true); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_Get.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_Get.cs new file mode 100644 index 000000000000..9d4089c9fd93 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_Get.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Returns current billing features for an Application Insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsComponentCurrentBillingFeature_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns current billing features for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsComponentCurrentBillingFeature_Get() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentCurrentBillingFeaturesGet(ResourceGroupName, SubscriptionId, Name, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity.cs new file mode 100644 index 000000000000..517c8177c3fc --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity.cs @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Returns current billing features for an Application Insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns current billing features for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentCurrentBillingFeaturesGetViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentCurrentBillingFeaturesGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_Get.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_Get.cs new file mode 100644 index 000000000000..2e83baca5469 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_Get.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Returns feature capabilities of the application insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/featurecapabilities" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsComponentFeatureCapability_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns feature capabilities of the application insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsComponentFeatureCapability_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsComponentFeatureCapability_Get() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentFeatureCapabilitiesGet(ResourceGroupName, SubscriptionId, Name, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity.cs new file mode 100644 index 000000000000..42a7d9afa542 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity.cs @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Returns feature capabilities of the application insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/featurecapabilities" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsComponentFeatureCapability_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns feature capabilities of the application insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentFeatureCapabilitiesGetViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentFeatureCapabilitiesGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_Get.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_Get.cs new file mode 100644 index 000000000000..fb88347c5a8d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_Get.cs @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Get status for an ongoing purge operation. + /// + /// [OpenAPI] GetPurgeStatus=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/operations/{purgeId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsComponentPurgeStatus_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get status for an ongoing purge operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsComponentPurgeStatus_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _purgeId; + + /// + /// In a purge status request, this is the Id of the operation the status of which is returned. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "In a purge status request, this is the Id of the operation the status of which is returned.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"In a purge status request, this is the Id of the operation the status of which is returned.", + SerializedName = @"purgeId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string PurgeId { get => this._purgeId; set => this._purgeId = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsComponentPurgeStatus_Get() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsGetPurgeStatus(ResourceGroupName, SubscriptionId, Name, PurgeId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,PurgeId=PurgeId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, PurgeId=PurgeId }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, PurgeId=PurgeId }) + { + 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 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.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse + WriteObject((await response).Status); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity.cs new file mode 100644 index 000000000000..2f2c34ee1440 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity.cs @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Get status for an ongoing purge operation. + /// + /// [OpenAPI] GetPurgeStatus=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/operations/{purgeId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsComponentPurgeStatus_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get status for an ongoing purge operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentsGetPurgeStatusViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PurgeId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PurgeId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentsGetPurgeStatus(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, InputObject.PurgeId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.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 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.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse + WriteObject((await response).Status); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_Get.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_Get.cs new file mode 100644 index 000000000000..19fe09f87e10 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_Get.cs @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Returns daily data volume cap (quota) status for an Application Insights component. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/quotastatus" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsComponentQuotaStatus_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns daily data volume cap (quota) status for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsComponentQuotaStatus_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsComponentQuotaStatus_Get() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentQuotaStatusGet(ResourceGroupName, SubscriptionId, Name, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity.cs new file mode 100644 index 000000000000..905ec5d1c78f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity.cs @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Returns daily data volume cap (quota) status for an Application Insights component. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/quotastatus" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsComponentQuotaStatus_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns daily data volume cap (quota) status for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentQuotaStatusGetViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentQuotaStatusGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_Get.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_Get.cs new file mode 100644 index 000000000000..7437988f3656 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_Get.cs @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Get the Continuous Export configuration for this export id. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsContinuousExport_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the Continuous Export configuration for this export id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsContinuousExport_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _exportId; + + /// + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Continuous Export configuration ID. This is unique within a Application Insights component.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Continuous Export configuration ID. This is unique within a Application Insights component.", + SerializedName = @"exportId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ExportId { get => this._exportId; set => this._exportId = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsContinuousExport_Get() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportConfigurationsGet(ResourceGroupName, SubscriptionId, Name, ExportId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,ExportId=ExportId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_GetViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_GetViaIdentity.cs new file mode 100644 index 000000000000..323fe374d6a6 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_GetViaIdentity.cs @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Get the Continuous Export configuration for this export id. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsContinuousExport_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the Continuous Export configuration for this export id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsContinuousExport_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsContinuousExport_GetViaIdentity() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ExportConfigurationsGetViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ExportId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExportId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ExportConfigurationsGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, InputObject.ExportId ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_List.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_List.cs new file mode 100644 index 000000000000..5019e61d3318 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_List.cs @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Gets a list of Continuous Export configuration of an Application Insights component. + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsContinuousExport_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Gets a list of Continuous Export configuration of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsContinuousExport_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsContinuousExport_List() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportConfigurationsList(ResourceGroupName, SubscriptionId, Name, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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 + // response should be returning an array of some kind. +Pageable + // array / / + WriteObject(await response, true); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_Get.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_Get.cs new file mode 100644 index 000000000000..1c90cb5ce3fe --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_Get.cs @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Returns the current linked storage settings for an Application Insights component. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsLinkedStorageAccount_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns the current linked storage settings for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsLinkedStorageAccount_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsLinkedStorageAccount_Get() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentLinkedStorageAccountsGet(ResourceGroupName, SubscriptionId, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + { + 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 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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity.cs new file mode 100644 index 000000000000..775a1c66a4ab --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity.cs @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Returns the current linked storage settings for an Application Insights component. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsLinkedStorageAccount_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns the current linked storage settings for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentLinkedStorageAccountsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentLinkedStorageAccountsGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.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 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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsOperation_List.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsOperation_List.cs index eab72170d3a1..ab956363d8a9 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsOperation_List.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsOperation_List.cs @@ -75,11 +75,11 @@ public partial class GetAzApplicationInsightsOperation_List : global::System.Man public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// - /// cancellation delegate. Stops the cmdlet when called. + /// cancellation delegate. Stops the cmdlet when called. /// global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// cancellation token. + /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// @@ -137,6 +137,11 @@ public partial class GetAzApplicationInsightsOperation_List : global::System.Man /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -148,7 +153,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -256,7 +261,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsOperation_List1.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsOperation_List1.cs new file mode 100644 index 000000000000..48742c89e0fd --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsOperation_List1.cs @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Lists all of the available insights REST API operations. + /// + /// [OpenAPI] List=>GET:"/providers/microsoft.insights/operations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsOperation_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Lists all of the available insights REST API operations.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsightsOperation_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsOperation_List1() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList1(onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.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 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 + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList1_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_Get.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_Get.cs index 093776df4615..4833747de219 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_Get.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_Get.cs @@ -66,11 +66,11 @@ public partial class GetAzApplicationInsightsWebTest_Get : global::System.Manage public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// - /// cancellation delegate. Stops the cmdlet when called. + /// cancellation delegate. Stops the cmdlet when called. /// global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// cancellation token. + /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// Backing field for property. @@ -158,6 +158,11 @@ public partial class GetAzApplicationInsightsWebTest_Get : global::System.Manage /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -169,7 +174,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -277,7 +282,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_GetViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_GetViaIdentity.cs index 283af8c0c878..1bf824d0cbeb 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_GetViaIdentity.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_GetViaIdentity.cs @@ -74,11 +74,11 @@ public partial class GetAzApplicationInsightsWebTest_GetViaIdentity : global::Sy public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// - /// cancellation delegate. Stops the cmdlet when called. + /// cancellation delegate. Stops the cmdlet when called. /// global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// cancellation token. + /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// @@ -119,6 +119,11 @@ public partial class GetAzApplicationInsightsWebTest_GetViaIdentity : global::Sy /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -130,7 +135,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -238,7 +243,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List.cs index 6099780d2287..499272c1a27d 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List.cs @@ -74,11 +74,11 @@ public partial class GetAzApplicationInsightsWebTest_List : global::System.Manag public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// - /// cancellation delegate. Stops the cmdlet when called. + /// cancellation delegate. Stops the cmdlet when called. /// global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// cancellation token. + /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// @@ -151,6 +151,11 @@ public partial class GetAzApplicationInsightsWebTest_List : global::System.Manag /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -162,7 +167,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -270,7 +275,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List1.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List1.cs index 2578c9a09944..65e0d75ea320 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List1.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List1.cs @@ -72,11 +72,11 @@ public partial class GetAzApplicationInsightsWebTest_List1 : global::System.Mana public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// - /// cancellation delegate. Stops the cmdlet when called. + /// cancellation delegate. Stops the cmdlet when called. /// global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// cancellation token. + /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// @@ -135,6 +135,11 @@ public partial class GetAzApplicationInsightsWebTest_List1 : global::System.Mana /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -146,7 +151,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -254,7 +259,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List2.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List2.cs index 0b48a7798de2..4061ea5b68d5 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List2.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List2.cs @@ -86,11 +86,11 @@ public partial class GetAzApplicationInsightsWebTest_List2 : global::System.Mana public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// - /// cancellation delegate. Stops the cmdlet when called. + /// cancellation delegate. Stops the cmdlet when called. /// global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// cancellation token. + /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// @@ -163,6 +163,11 @@ public partial class GetAzApplicationInsightsWebTest_List2 : global::System.Mana /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -174,7 +179,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -282,7 +287,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_Get.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_Get.cs new file mode 100644 index 000000000000..4e3a08cebf3a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_Get.cs @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Returns an Application Insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsights_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsights_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsights_Get() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsGet(ResourceGroupName, SubscriptionId, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + { + 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 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_GetViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_GetViaIdentity.cs new file mode 100644 index 000000000000..0fd15673de0b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_GetViaIdentity.cs @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Returns an Application Insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsights_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsights_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsights_GetViaIdentity() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentsGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.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 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List.cs new file mode 100644 index 000000000000..dd2541725001 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Gets a list of all Application Insights components within a subscription. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/microsoft.insights/components" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsights_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Gets a list of all Application Insights components within a subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsights_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsights_List() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsList(SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + 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 { SubscriptionId=SubscriptionId }) + { + 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 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 + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List1.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List1.cs new file mode 100644 index 000000000000..2d531799ab96 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List1.cs @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Gets a list of Application Insights components within a resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsights_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Gets a list of Application Insights components within a resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class GetAzApplicationInsights_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsights_List1() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsListByResourceGroup(ResourceGroupName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId }) + { + 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 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 + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateExpanded.cs new file mode 100644 index 000000000000..074d16dc8a80 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateExpanded.cs @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Create an Annotation of an Application Insights component. + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsAnnotation_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Create an Annotation of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class NewAzApplicationInsightsAnnotation_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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; + + /// Annotation associated with an application insights resource. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation _annotationPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.Annotation(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Name of annotation + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of annotation")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of annotation", + SerializedName = @"AnnotationName", + PossibleTypes = new [] { typeof(string) })] + public string AnnotationName { get => _annotationPropertiesBody.Name ?? null; set => _annotationPropertiesBody.Name = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Category of annotation, free form + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Category of annotation, free form")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Category of annotation, free form", + SerializedName = @"Category", + PossibleTypes = new [] { typeof(string) })] + public string Category { get => _annotationPropertiesBody.Category ?? null; set => _annotationPropertiesBody.Category = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Time when event occurred + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time when event occurred")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time when event occurred", + SerializedName = @"EventTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime EventTime { get => _annotationPropertiesBody.EventTime ?? default(global::System.DateTime); set => _annotationPropertiesBody.EventTime = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Unique Id for annotation + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unique Id for annotation")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique Id for annotation", + SerializedName = @"Id", + PossibleTypes = new [] { typeof(string) })] + public string Id { get => _annotationPropertiesBody.Id ?? null; set => _annotationPropertiesBody.Id = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + + /// Serialized JSON object for detailed properties + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Serialized JSON object for detailed properties")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Serialized JSON object for detailed properties", + SerializedName = @"Properties", + PossibleTypes = new [] { typeof(string) })] + public string Property { get => _annotationPropertiesBody.Property ?? null; set => _annotationPropertiesBody.Property = value; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Related parent annotation if any + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Related parent annotation if any")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Related parent annotation if any", + SerializedName = @"RelatedAnnotation", + PossibleTypes = new [] { typeof(string) })] + public string RelatedAnnotation { get => _annotationPropertiesBody.RelatedAnnotation ?? null; set => _annotationPropertiesBody.RelatedAnnotation = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsAnnotation_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AnnotationsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AnnotationsCreate(ResourceGroupName, SubscriptionId, ResourceName, _annotationPropertiesBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,ResourceName=ResourceName,body=_annotationPropertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, ResourceName=ResourceName, body=_annotationPropertiesBody }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, ResourceName=ResourceName, body=_annotationPropertiesBody }) + { + 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 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 + // response should be returning an array of some kind. +Pageable + // array / / + WriteObject(await response, true); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateExpanded.cs new file mode 100644 index 000000000000..1b83ccac092f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateExpanded.cs @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Create an API Key of an Application Insights component. + /// + /// [OpenAPI] Create=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsApiKey_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Create an API Key of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class NewAzApplicationInsightsApiKey_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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; + + /// An Application Insights component API Key creation request definition. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest _apiKeyPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApiKeyRequest(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The name of the API Key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the API Key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the API Key.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _apiKeyPropertiesBody.Name ?? null; set => _apiKeyPropertiesBody.Name = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The read access rights of this API Key. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The read access rights of this API Key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The read access rights of this API Key.", + SerializedName = @"linkedReadProperties", + PossibleTypes = new [] { typeof(string) })] + public string[] LinkedReadProperty { get => _apiKeyPropertiesBody.LinkedReadProperty ?? null /* arrayOf */; set => _apiKeyPropertiesBody.LinkedReadProperty = value; } + + /// The write access rights of this API Key. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The write access rights of this API Key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The write access rights of this API Key.", + SerializedName = @"linkedWriteProperties", + PossibleTypes = new [] { typeof(string) })] + public string[] LinkedWriteProperty { get => _apiKeyPropertiesBody.LinkedWriteProperty ?? null /* arrayOf */; set => _apiKeyPropertiesBody.LinkedWriteProperty = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsApiKey_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApiKeysCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApiKeysCreate(ResourceGroupName, SubscriptionId, Name, _apiKeyPropertiesBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_apiKeyPropertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateExpanded.cs new file mode 100644 index 000000000000..74f1a2189168 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateExpanded.cs @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Create a Continuous Export configuration of an Application Insights component. + /// + /// [OpenAPI] Create=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsContinuousExport_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Create a Continuous Export configuration of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class NewAzApplicationInsightsContinuousExport_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// An Application Insights component Continuous Export configuration request definition. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest _exportPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportRequest(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The subscription ID of the destination storage container. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The subscription ID of the destination storage container.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The subscription ID of the destination storage container.", + SerializedName = @"DestinationStorageSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + public string DestinationStorageSubscriptionId { get => _exportPropertiesBody.DestinationStorageSubscriptionId ?? null; set => _exportPropertiesBody.DestinationStorageSubscriptionId = value; } + + /// The Continuous Export destination type. This has to be 'Blob'. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Continuous Export destination type. This has to be 'Blob'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Continuous Export destination type. This has to be 'Blob'.", + SerializedName = @"DestinationType", + PossibleTypes = new [] { typeof(string) })] + public string DestinationType { get => _exportPropertiesBody.DestinationType ?? null; set => _exportPropertiesBody.DestinationType = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'.", + SerializedName = @"IsEnabled", + PossibleTypes = new [] { typeof(string) })] + public string IsEnabled { get => _exportPropertiesBody.IsEnabled ?? null; set => _exportPropertiesBody.IsEnabled = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Deprecated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Deprecated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Deprecated", + SerializedName = @"NotificationQueueEnabled", + PossibleTypes = new [] { typeof(string) })] + public string NotificationQueueEnabled { get => _exportPropertiesBody.NotificationQueueEnabled ?? null; set => _exportPropertiesBody.NotificationQueueEnabled = value; } + + /// Deprecated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Deprecated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Deprecated", + SerializedName = @"NotificationQueueUri", + PossibleTypes = new [] { typeof(string) })] + public string NotificationQueueUri { get => _exportPropertiesBody.NotificationQueueUri ?? null; set => _exportPropertiesBody.NotificationQueueUri = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', + /// 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'.", + SerializedName = @"RecordTypes", + PossibleTypes = new [] { typeof(string) })] + public string RecordType { get => _exportPropertiesBody.RecordType ?? null; set => _exportPropertiesBody.RecordType = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The name of destination storage account. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of destination storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of destination storage account.", + SerializedName = @"DestinationAccountId", + PossibleTypes = new [] { typeof(string) })] + public string StorageAccountId { get => _exportPropertiesBody.DestinationAccountId ?? null; set => _exportPropertiesBody.DestinationAccountId = value; } + + /// The location ID of the destination storage container. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The location ID of the destination storage container.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The location ID of the destination storage container.", + SerializedName = @"DestinationStorageLocationId", + PossibleTypes = new [] { typeof(string) })] + public string StorageLocation { get => _exportPropertiesBody.DestinationStorageLocationId ?? null; set => _exportPropertiesBody.DestinationStorageLocationId = value; } + + /// + /// The SAS URL for the destination storage container. It must grant write permission. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SAS URL for the destination storage container. It must grant write permission.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS URL for the destination storage container. It must grant write permission.", + SerializedName = @"DestinationAddress", + PossibleTypes = new [] { typeof(string) })] + public string StorageSASUri { get => _exportPropertiesBody.DestinationAddress ?? null; set => _exportPropertiesBody.DestinationAddress = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsContinuousExport_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportConfigurationsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportConfigurationsCreate(ResourceGroupName, SubscriptionId, Name, _exportPropertiesBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_exportPropertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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 + // response should be returning an array of some kind. +Pageable + // array / / + WriteObject(await response, true); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded.cs new file mode 100644 index 000000000000..5b1580de4b0e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Replace current linked storage account for an Application Insights component. + /// + /// [OpenAPI] CreateAndUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsLinkedStorageAccount_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Replace current linked storage account for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// An Application Insights component linked storage accounts + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts _linkedStorageAccountsPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ComponentLinkedStorageAccounts(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Linked storage account resource ID + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Linked storage account resource ID")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Linked storage account resource ID", + SerializedName = @"linkedStorageAccount", + PossibleTypes = new [] { typeof(string) })] + public string LinkedStorageAccountResourceId { get => _linkedStorageAccountsPropertiesBody.LinkedStorageAccount ?? null; set => _linkedStorageAccountsPropertiesBody.LinkedStorageAccount = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentLinkedStorageAccountsCreateAndUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentLinkedStorageAccountsCreateAndUpdate(ResourceGroupName, SubscriptionId, Name, _linkedStorageAccountsPropertiesBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_linkedStorageAccountsPropertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_linkedStorageAccountsPropertiesBody }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_linkedStorageAccountsPropertiesBody }) + { + 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 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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateExpanded.cs index 8ea2bc1912de..91ac0ace7ea3 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateExpanded.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateExpanded.cs @@ -34,6 +34,9 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// An Application Insights WebTest definition. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest _webTestDefinitionBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTest(); + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] @@ -51,7 +54,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"The XML specification of a WebTest to run against an application.", SerializedName = @"WebTest", PossibleTypes = new [] { typeof(string) })] - public string Configuration { get => WebTestDefinitionBody.ConfigurationWebTest ?? null; set => WebTestDefinitionBody.ConfigurationWebTest = value; } + public string Configuration { get => _webTestDefinitionBody.ConfigurationWebTest ?? null; set => _webTestDefinitionBody.ConfigurationWebTest = value; } /// When set, this value makes the ContentMatch validation case insensitive. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When set, this value makes the ContentMatch validation case insensitive.")] @@ -62,7 +65,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"When set, this value makes the ContentMatch validation case insensitive.", SerializedName = @"IgnoreCase", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter ContentIgnoreCase { get => WebTestDefinitionBody.ContentValidationIgnoreCase ?? default(global::System.Management.Automation.SwitchParameter); set => WebTestDefinitionBody.ContentValidationIgnoreCase = value; } + public global::System.Management.Automation.SwitchParameter ContentIgnoreCase { get => _webTestDefinitionBody.ContentValidationIgnoreCase ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.ContentValidationIgnoreCase = value; } /// Content to look for in the return of the WebTest. Must not be null or empty. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Content to look for in the return of the WebTest. Must not be null or empty.")] @@ -73,7 +76,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Content to look for in the return of the WebTest. Must not be null or empty.", SerializedName = @"ContentMatch", PossibleTypes = new [] { typeof(string) })] - public string ContentMatch { get => WebTestDefinitionBody.ContentValidationContentMatch ?? null; set => WebTestDefinitionBody.ContentValidationContentMatch = value; } + public string ContentMatch { get => _webTestDefinitionBody.ContentValidationContentMatch ?? null; set => _webTestDefinitionBody.ContentValidationContentMatch = value; } /// /// When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there @@ -87,7 +90,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there is a match", SerializedName = @"PassIfTextFound", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter ContentPassIfTextFound { get => WebTestDefinitionBody.ContentValidationPassIfTextFound ?? default(global::System.Management.Automation.SwitchParameter); set => WebTestDefinitionBody.ContentValidationPassIfTextFound = value; } + public global::System.Management.Automation.SwitchParameter ContentPassIfTextFound { get => _webTestDefinitionBody.ContentValidationPassIfTextFound ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.ContentValidationPassIfTextFound = value; } /// /// The credentials, account, tenant, and subscription used for communication with Azure @@ -107,7 +110,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"User defined description for this WebTest.", SerializedName = @"Description", PossibleTypes = new [] { typeof(string) })] - public string Description { get => WebTestDefinitionBody.Description ?? null; set => WebTestDefinitionBody.Description = value; } + public string Description { get => _webTestDefinitionBody.Description ?? null; set => _webTestDefinitionBody.Description = value; } /// Is the test actively being monitored. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Is the test actively being monitored.")] @@ -118,7 +121,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Is the test actively being monitored.", SerializedName = @"Enabled", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter Enabled { get => WebTestDefinitionBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => WebTestDefinitionBody.Enabled = value; } + public global::System.Management.Automation.SwitchParameter Enabled { get => _webTestDefinitionBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.Enabled = value; } /// Interval in seconds between test runs for this WebTest. Default value is 300. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Interval in seconds between test runs for this WebTest. Default value is 300.")] @@ -129,7 +132,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Interval in seconds between test runs for this WebTest. Default value is 300.", SerializedName = @"Frequency", PossibleTypes = new [] { typeof(int) })] - public int Frequency { get => WebTestDefinitionBody.Frequency ?? default(int); set => WebTestDefinitionBody.Frequency = value; } + public int Frequency { get => _webTestDefinitionBody.Frequency ?? default(int); set => _webTestDefinitionBody.Frequency = value; } /// /// A list of where to physically run the tests from to give global coverage for accessibility of your application. @@ -143,7 +146,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"A list of where to physically run the tests from to give global coverage for accessibility of your application.", SerializedName = @"Locations", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation[] GeoLocation { get => WebTestDefinitionBody.PropertiesLocations ?? null /* arrayOf */; set => WebTestDefinitionBody.PropertiesLocations = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation[] GeoLocation { get => _webTestDefinitionBody.PropertiesLocations ?? null /* arrayOf */; set => _webTestDefinitionBody.PropertiesLocations = value; } /// The kind of WebTest that this web test watches. Choices are ping and multistep. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The kind of WebTest that this web test watches. Choices are ping and multistep.")] @@ -156,7 +159,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotExport] [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind))] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind HideKind { get => WebTestDefinitionBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind)""); set => WebTestDefinitionBody.Kind = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind HideKind { get => _webTestDefinitionBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind)""); set => _webTestDefinitionBody.Kind = 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")] @@ -183,7 +186,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy SerializedName = @"Kind", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum) })] [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum Kind { get => WebTestDefinitionBody.WebTestKind ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum)""); set => WebTestDefinitionBody.WebTestKind = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum Kind { get => _webTestDefinitionBody.WebTestKind ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum)""); set => _webTestDefinitionBody.WebTestKind = value; } /// Resource location [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource location")] @@ -194,14 +197,14 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Resource location", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] - public string Location { get => WebTestDefinitionBody.Location ?? null; set => WebTestDefinitionBody.Location = value; } + public string Location { get => _webTestDefinitionBody.Location ?? null; set => _webTestDefinitionBody.Location = value; } /// - /// cancellation delegate. Stops the cmdlet when called. + /// cancellation delegate. Stops the cmdlet when called. /// global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// cancellation token. + /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// Backing field for property. @@ -249,7 +252,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Base64 encoded string body to send with this web test.", SerializedName = @"RequestBody", PossibleTypes = new [] { typeof(string) })] - public string RequestBody { get => WebTestDefinitionBody.RequestBody ?? null; set => WebTestDefinitionBody.RequestBody = value; } + public string RequestBody { get => _webTestDefinitionBody.RequestBody ?? null; set => _webTestDefinitionBody.RequestBody = value; } /// Follow redirects for this web test. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Follow redirects for this web test.")] @@ -260,7 +263,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Follow redirects for this web test.", SerializedName = @"FollowRedirects", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter RequestFollowRedirect { get => WebTestDefinitionBody.RequestFollowRedirect ?? default(global::System.Management.Automation.SwitchParameter); set => WebTestDefinitionBody.RequestFollowRedirect = value; } + public global::System.Management.Automation.SwitchParameter RequestFollowRedirect { get => _webTestDefinitionBody.RequestFollowRedirect ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.RequestFollowRedirect = value; } /// List of headers and their values to add to the WebTest call. [global::System.Management.Automation.AllowEmptyCollection] @@ -272,7 +275,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"List of headers and their values to add to the WebTest call.", SerializedName = @"Headers", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField[] RequestHeader { get => WebTestDefinitionBody.RequestHeader ?? null /* arrayOf */; set => WebTestDefinitionBody.RequestHeader = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField[] RequestHeader { get => _webTestDefinitionBody.RequestHeader ?? null /* arrayOf */; set => _webTestDefinitionBody.RequestHeader = value; } /// Http verb to use for this web test. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Http verb to use for this web test.")] @@ -283,7 +286,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Http verb to use for this web test.", SerializedName = @"HttpVerb", PossibleTypes = new [] { typeof(string) })] - public string RequestHttpVerb { get => WebTestDefinitionBody.RequestHttpVerb ?? null; set => WebTestDefinitionBody.RequestHttpVerb = value; } + public string RequestHttpVerb { get => _webTestDefinitionBody.RequestHttpVerb ?? null; set => _webTestDefinitionBody.RequestHttpVerb = value; } /// Parse Dependent request for this WebTest. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Parse Dependent request for this WebTest.")] @@ -294,7 +297,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Parse Dependent request for this WebTest.", SerializedName = @"ParseDependentRequests", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter RequestParseDependent { get => WebTestDefinitionBody.RequestParseDependentRequest ?? default(global::System.Management.Automation.SwitchParameter); set => WebTestDefinitionBody.RequestParseDependentRequest = value; } + public global::System.Management.Automation.SwitchParameter RequestParseDependent { get => _webTestDefinitionBody.RequestParseDependentRequest ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.RequestParseDependentRequest = value; } /// Url location to test. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Url location to test.")] @@ -305,7 +308,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Url location to test.", SerializedName = @"RequestUrl", PossibleTypes = new [] { typeof(string) })] - public string RequestUrl { get => WebTestDefinitionBody.RequestUrl ?? null; set => WebTestDefinitionBody.RequestUrl = value; } + public string RequestUrl { get => _webTestDefinitionBody.RequestUrl ?? null; set => _webTestDefinitionBody.RequestUrl = value; } /// Backing field for property. private string _resourceGroupName; @@ -330,7 +333,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Allow for retries should this WebTest fail.", SerializedName = @"RetryEnabled", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter RetryEnabled { get => WebTestDefinitionBody.RetryEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => WebTestDefinitionBody.RetryEnabled = value; } + public global::System.Management.Automation.SwitchParameter RetryEnabled { get => _webTestDefinitionBody.RetryEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.RetryEnabled = value; } /// Validate that the WebTest returns the http status code provided. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Validate that the WebTest returns the http status code provided.")] @@ -341,7 +344,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Validate that the WebTest returns the http status code provided.", SerializedName = @"ExpectedHttpStatusCode", PossibleTypes = new [] { typeof(int) })] - public int RuleExpectedHttpStatusCode { get => WebTestDefinitionBody.ValidationRuleExpectedHttpStatusCode ?? default(int); set => WebTestDefinitionBody.ValidationRuleExpectedHttpStatusCode = value; } + public int RuleExpectedHttpStatusCode { get => _webTestDefinitionBody.ValidationRuleExpectedHttpStatusCode ?? default(int); set => _webTestDefinitionBody.ValidationRuleExpectedHttpStatusCode = value; } /// When set, validation will ignore the status code. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When set, validation will ignore the status code.")] @@ -352,7 +355,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"When set, validation will ignore the status code.", SerializedName = @"IgnoreHttpsStatusCode", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter RuleIgnoreHttpsStatusCode { get => WebTestDefinitionBody.ValidationRuleIgnoreHttpsStatusCode ?? default(global::System.Management.Automation.SwitchParameter); set => WebTestDefinitionBody.ValidationRuleIgnoreHttpsStatusCode = value; } + public global::System.Management.Automation.SwitchParameter RuleIgnoreHttpsStatusCode { get => _webTestDefinitionBody.ValidationRuleIgnoreHttpsStatusCode ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.ValidationRuleIgnoreHttpsStatusCode = value; } /// /// A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck @@ -366,7 +369,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck must be set to true.", SerializedName = @"SSLCertRemainingLifetimeCheck", PossibleTypes = new [] { typeof(int) })] - public int RuleSslCertRemainingLifetimeCheck { get => WebTestDefinitionBody.ValidationRuleSslCertRemainingLifetimeCheck ?? default(int); set => WebTestDefinitionBody.ValidationRuleSslCertRemainingLifetimeCheck = value; } + public int RuleSslCertRemainingLifetimeCheck { get => _webTestDefinitionBody.ValidationRuleSslCertRemainingLifetimeCheck ?? default(int); set => _webTestDefinitionBody.ValidationRuleSslCertRemainingLifetimeCheck = value; } /// Checks to see if the SSL cert is still valid. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Checks to see if the SSL cert is still valid.")] @@ -377,7 +380,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Checks to see if the SSL cert is still valid.", SerializedName = @"SSLCheck", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter RuleSslCheck { get => WebTestDefinitionBody.ValidationRuleSslCheck ?? default(global::System.Management.Automation.SwitchParameter); set => WebTestDefinitionBody.ValidationRuleSslCheck = value; } + public global::System.Management.Automation.SwitchParameter RuleSslCheck { get => _webTestDefinitionBody.ValidationRuleSslCheck ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.ValidationRuleSslCheck = value; } /// Backing field for property. private string _subscriptionId; @@ -407,7 +410,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy SerializedName = @"SyntheticMonitorId", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotExport] - public string SyntheticMonitorId { get => WebTestDefinitionBody.SyntheticMonitorId ?? null; set => WebTestDefinitionBody.SyntheticMonitorId = value; } + public string SyntheticMonitorId { get => _webTestDefinitionBody.SyntheticMonitorId ?? null; set => _webTestDefinitionBody.SyntheticMonitorId = value; } /// Resource tags [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -419,7 +422,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Resource tags", SerializedName = @"tags", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags Tag { get => WebTestDefinitionBody.Tag ?? null /* object */; set => WebTestDefinitionBody.Tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags Tag { get => _webTestDefinitionBody.Tag ?? null /* object */; set => _webTestDefinitionBody.Tag = value; } /// User defined name if this WebTest. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User defined name if this WebTest.")] @@ -430,7 +433,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"User defined name if this WebTest.", SerializedName = @"Name", PossibleTypes = new [] { typeof(string) })] - public string TestName { get => WebTestDefinitionBody.WebTestName ?? null; set => WebTestDefinitionBody.WebTestName = value; } + public string TestName { get => _webTestDefinitionBody.WebTestName ?? null; set => _webTestDefinitionBody.WebTestName = value; } /// Seconds until this WebTest will timeout and fail. Default value is 30. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Seconds until this WebTest will timeout and fail. Default value is 30.")] @@ -441,13 +444,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy Description = @"Seconds until this WebTest will timeout and fail. Default value is 30.", SerializedName = @"Timeout", PossibleTypes = new [] { typeof(int) })] - public int Timeout { get => WebTestDefinitionBody.Timeout ?? default(int); set => WebTestDefinitionBody.Timeout = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest _webTestDefinitionBody= new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTest(); - - /// An Application Insights WebTest definition. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest WebTestDefinitionBody { get => this._webTestDefinitionBody; set => this._webTestDefinitionBody = value; } + public int Timeout { get => _webTestDefinitionBody.Timeout ?? default(int); set => _webTestDefinitionBody.Timeout = value; } /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -466,6 +463,11 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -477,7 +479,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -588,7 +590,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) @@ -603,12 +604,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WebTestsCreateOrUpdate(ResourceGroupName, SubscriptionId, Name, WebTestDefinitionBody, onOk, this, Pipeline); + await this.Client.WebTestsCreateOrUpdate(ResourceGroupName, SubscriptionId, Name, _webTestDefinitionBody, onOk, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=WebTestDefinitionBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_webTestDefinitionBody}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateExpanded.cs new file mode 100644 index 000000000000..bcb357641b80 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateExpanded.cs @@ -0,0 +1,632 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// nor AppId in the Put operation. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsights_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class NewAzApplicationInsights_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// An Application Insights component definition. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent _insightPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent(); + + /// Type of application being monitored. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of application being monitored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of application being monitored.", + SerializedName = @"Application_Type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType ApplicationType { get => _insightPropertiesBody.ApplicationType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType)""); set => _insightPropertiesBody.ApplicationType = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Disable IP masking. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Disable IP masking.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disable IP masking.", + SerializedName = @"DisableIpMasking", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableIPMasking { get => _insightPropertiesBody.DisableIPMasking ?? default(global::System.Management.Automation.SwitchParameter); set => _insightPropertiesBody.DisableIPMasking = value; } + + /// Disable Non-AAD based Auth. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Disable Non-AAD based Auth.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disable Non-AAD based Auth.", + SerializedName = @"DisableLocalAuth", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAuth { get => _insightPropertiesBody.DisableLocalAuth ?? default(global::System.Management.Automation.SwitchParameter); set => _insightPropertiesBody.DisableLocalAuth = value; } + + /// Resource etag + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource etag")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource etag", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _insightPropertiesBody.Etag ?? null; set => _insightPropertiesBody.Etag = value; } + + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.", + SerializedName = @"Flow_Type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType FlowType { get => _insightPropertiesBody.FlowType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType)""); set => _insightPropertiesBody.FlowType = value; } + + /// Force users to create their own storage account for profiler and debugger. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Force users to create their own storage account for profiler and debugger.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Force users to create their own storage account for profiler and debugger.", + SerializedName = @"ForceCustomerStorageForProfiler", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ForceCustomerStorageForProfiler { get => _insightPropertiesBody.ForceCustomerStorageForProfiler ?? default(global::System.Management.Automation.SwitchParameter); set => _insightPropertiesBody.ForceCustomerStorageForProfiler = value; } + + /// + /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp.", + SerializedName = @"HockeyAppId", + PossibleTypes = new [] { typeof(string) })] + public string HockeyAppId { get => _insightPropertiesBody.HockeyAppId ?? null; set => _insightPropertiesBody.HockeyAppId = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Purge data immediately after 30 days. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Purge data immediately after 30 days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Purge data immediately after 30 days.", + SerializedName = @"ImmediatePurgeDataOn30Days", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ImmediatePurgeDataOn30Day { get => _insightPropertiesBody.ImmediatePurgeDataOn30Day ?? default(global::System.Management.Automation.SwitchParameter); set => _insightPropertiesBody.ImmediatePurgeDataOn30Day = value; } + + /// Indicates the flow of the ingestion. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates the flow of the ingestion.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the flow of the ingestion.", + SerializedName = @"IngestionMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode IngestionMode { get => _insightPropertiesBody.IngestionMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode)""); set => _insightPropertiesBody.IngestionMode = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should + /// typically be one of the following: web, ios, other, store, java, phone. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + public string Kind { get => _insightPropertiesBody.Kind ?? null; set => _insightPropertiesBody.Kind = value; } + + /// Resource location + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource location")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource location", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _insightPropertiesBody.Location ?? null; set => _insightPropertiesBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The network access type for accessing Application Insights ingestion. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The network access type for accessing Application Insights ingestion.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network access type for accessing Application Insights ingestion.", + SerializedName = @"publicNetworkAccessForIngestion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType PublicNetworkAccessForIngestion { get => _insightPropertiesBody.PublicNetworkAccessForIngestion ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType)""); set => _insightPropertiesBody.PublicNetworkAccessForIngestion = value; } + + /// The network access type for accessing Application Insights query. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The network access type for accessing Application Insights query.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network access type for accessing Application Insights query.", + SerializedName = @"publicNetworkAccessForQuery", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType PublicNetworkAccessForQuery { get => _insightPropertiesBody.PublicNetworkAccessForQuery ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType)""); set => _insightPropertiesBody.PublicNetworkAccessForQuery = value; } + + /// + /// Describes what tool created this Application Insights component. Customers using this API should set this to the default + /// 'rest'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.", + SerializedName = @"Request_Source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource RequestSource { get => _insightPropertiesBody.RequestSource ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource)""); set => _insightPropertiesBody.RequestSource = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Retention period in days. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Retention period in days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention period in days.", + SerializedName = @"RetentionInDays", + PossibleTypes = new [] { typeof(int) })] + public int RetentionInDay { get => _insightPropertiesBody.RetentionInDay ?? default(int); set => _insightPropertiesBody.RetentionInDay = value; } + + /// + /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry.", + SerializedName = @"SamplingPercentage", + PossibleTypes = new [] { typeof(double) })] + public double SamplingPercentage { get => _insightPropertiesBody.SamplingPercentage ?? default(double); set => _insightPropertiesBody.SamplingPercentage = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Resource tags + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags Tag { get => _insightPropertiesBody.Tag ?? null /* object */; set => _insightPropertiesBody.Tag = value; } + + /// + /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an + /// application with this API version. Applications from older versions will not have this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an application with this API version. Applications from older versions will not have this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an application with this API version. Applications from older versions will not have this property.", + SerializedName = @"WorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string WorkspaceResourceId { get => _insightPropertiesBody.WorkspaceResourceId ?? null; set => _insightPropertiesBody.WorkspaceResourceId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsights_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsCreateOrUpdate(ResourceGroupName, SubscriptionId, Name, _insightPropertiesBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_insightPropertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_insightPropertiesBody }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_insightPropertiesBody }) + { + 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 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_Delete.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_Delete.cs new file mode 100644 index 000000000000..fbfc801afdd9 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_Delete.cs @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Delete an Annotation of an Application Insights component. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzApplicationInsightsAnnotation_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Delete an Annotation of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class RemoveAzApplicationInsightsAnnotation_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _id; + + /// + /// The unique annotation ID. This is unique within a Application Insights component. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The unique annotation ID. This is unique within a Application Insights component.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The unique annotation ID. This is unique within a Application Insights component.", + SerializedName = @"annotationId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AnnotationId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Id { get => this._id; set => this._id = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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. + /// /// 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, 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AnnotationsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AnnotationsDelete(ResourceGroupName, SubscriptionId, ResourceName, Id, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,ResourceName=ResourceName,Id=Id}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzApplicationInsightsAnnotation_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// 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 onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity.cs new file mode 100644 index 000000000000..e67c95d4df3b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Delete an Annotation of an Application Insights component. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzApplicationInsightsAnnotation_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Delete an Annotation of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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. + /// /// 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, 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AnnotationsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AnnotationsDeleteViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AnnotationId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AnnotationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AnnotationsDelete(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, InputObject.AnnotationId ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// 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 onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_Delete.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_Delete.cs new file mode 100644 index 000000000000..ebbc8e394de3 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_Delete.cs @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Delete an API Key of an Application Insights component. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzApplicationInsightsApiKey_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Delete an API Key of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class RemoveAzApplicationInsightsApiKey_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _apiKeyId; + + /// The API Key ID. This is unique within a Application Insights component. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The API Key ID. This is unique within a Application Insights component.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The API Key ID. This is unique within a Application Insights component.", + SerializedName = @"keyId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ApiKeyId { get => this._apiKeyId; set => this._apiKeyId = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApiKeysDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApiKeysDelete(ResourceGroupName, SubscriptionId, Name, ApiKeyId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,ApiKeyId=ApiKeyId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzApplicationInsightsApiKey_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_DeleteViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_DeleteViaIdentity.cs new file mode 100644 index 000000000000..ea083b25c3e8 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_DeleteViaIdentity.cs @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Delete an API Key of an Application Insights component. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzApplicationInsightsApiKey_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Delete an API Key of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class RemoveAzApplicationInsightsApiKey_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApiKeysDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ApiKeysDeleteViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.KeyId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.KeyId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ApiKeysDelete(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, InputObject.KeyId ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzApplicationInsightsApiKey_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_Delete.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_Delete.cs new file mode 100644 index 000000000000..8a6a91673e59 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_Delete.cs @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Delete a Continuous Export configuration of an Application Insights component. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzApplicationInsightsContinuousExport_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Delete a Continuous Export configuration of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class RemoveAzApplicationInsightsContinuousExport_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _exportId; + + /// + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Continuous Export configuration ID. This is unique within a Application Insights component.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Continuous Export configuration ID. This is unique within a Application Insights component.", + SerializedName = @"exportId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ExportId { get => this._exportId; set => this._exportId = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportConfigurationsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportConfigurationsDelete(ResourceGroupName, SubscriptionId, Name, ExportId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,ExportId=ExportId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzApplicationInsightsContinuousExport_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentity.cs new file mode 100644 index 000000000000..ffbb7d18bbb5 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentity.cs @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Delete a Continuous Export configuration of an Application Insights component. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzApplicationInsightsContinuousExport_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Delete a Continuous Export configuration of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportConfigurationsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ExportConfigurationsDeleteViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ExportId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExportId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ExportConfigurationsDelete(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, InputObject.ExportId ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_Delete.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_Delete.cs new file mode 100644 index 000000000000..ef70c3eec168 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_Delete.cs @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Delete linked storage accounts for an Application Insights component. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzApplicationInsightsLinkedStorageAccount_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Delete linked storage accounts for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class RemoveAzApplicationInsightsLinkedStorageAccount_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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 onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentLinkedStorageAccountsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentLinkedStorageAccountsDelete(ResourceGroupName, SubscriptionId, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzApplicationInsightsLinkedStorageAccount_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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 onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// 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 onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity.cs new file mode 100644 index 000000000000..c8239cfbbde3 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Delete linked storage accounts for an Application Insights component. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Delete linked storage accounts for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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 onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentLinkedStorageAccountsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentLinkedStorageAccountsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentLinkedStorageAccountsDelete(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.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 204 (NoContent). + /// 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 onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// 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 onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_Delete.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_Delete.cs index 229ca2d3ab57..810630d72bd0 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_Delete.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_Delete.cs @@ -66,11 +66,11 @@ public partial class RemoveAzApplicationInsightsWebTest_Delete : global::System. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// - /// cancellation delegate. Stops the cmdlet when called. + /// cancellation delegate. Stops the cmdlet when called. /// global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// cancellation token. + /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// Backing field for property. @@ -173,6 +173,11 @@ public partial class RemoveAzApplicationInsightsWebTest_Delete : global::System. /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -184,7 +189,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -287,7 +292,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_DeleteViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_DeleteViaIdentity.cs index d96d2f5fc687..d4b81f12b568 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_DeleteViaIdentity.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_DeleteViaIdentity.cs @@ -74,11 +74,11 @@ public partial class RemoveAzApplicationInsightsWebTest_DeleteViaIdentity : glob public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// - /// cancellation delegate. Stops the cmdlet when called. + /// cancellation delegate. Stops the cmdlet when called. /// global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// cancellation token. + /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// @@ -134,6 +134,11 @@ public partial class RemoveAzApplicationInsightsWebTest_DeleteViaIdentity : glob /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -145,7 +150,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -248,7 +253,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_Delete.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_Delete.cs new file mode 100644 index 000000000000..c71abd45489d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_Delete.cs @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Deletes an Application Insights component. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzApplicationInsights_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Deletes an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class RemoveAzApplicationInsights_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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 onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsDelete(ResourceGroupName, SubscriptionId, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzApplicationInsights_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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 onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// 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 onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_DeleteViaIdentity.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_DeleteViaIdentity.cs new file mode 100644 index 000000000000..e5ace17eff43 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_DeleteViaIdentity.cs @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Deletes an Application Insights component. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzApplicationInsights_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Deletes an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class RemoveAzApplicationInsights_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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 onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentsDelete(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzApplicationInsights_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.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 204 (NoContent). + /// 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 onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// 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 onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded.cs new file mode 100644 index 000000000000..149ce773b6e0 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded.cs @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Update current billing features for an Application Insights component. + /// + /// [OpenAPI] Update=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Set, @"AzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Update current billing features for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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; + + /// An Application Insights component billing features + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures _billingFeaturesPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentBillingFeatures(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application + /// Insights Enterprise'. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'.", + SerializedName = @"CurrentBillingFeatures", + PossibleTypes = new [] { typeof(string) })] + public string[] CurrentBillingFeature { get => _billingFeaturesPropertiesBody.CurrentBillingFeature ?? null /* arrayOf */; set => _billingFeaturesPropertiesBody.CurrentBillingFeature = value; } + + /// Daily data volume cap in GB. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Daily data volume cap in GB.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Daily data volume cap in GB.", + SerializedName = @"Cap", + PossibleTypes = new [] { typeof(float) })] + public float DataVolumeCap { get => _billingFeaturesPropertiesBody.DataVolumeCapCap ?? default(float); set => _billingFeaturesPropertiesBody.DataVolumeCapCap = value; } + + /// Do not send a notification email when the daily data volume cap is met. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Do not send a notification email when the daily data volume cap is met.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Do not send a notification email when the daily data volume cap is met.", + SerializedName = @"StopSendNotificationWhenHitCap", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DataVolumeCapStopSendNotificationWhenHitCap { get => _billingFeaturesPropertiesBody.DataVolumeCapStopSendNotificationWhenHitCap ?? default(global::System.Management.Automation.SwitchParameter); set => _billingFeaturesPropertiesBody.DataVolumeCapStopSendNotificationWhenHitCap = value; } + + /// Reserved, not used for now. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Reserved, not used for now.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reserved, not used for now.", + SerializedName = @"StopSendNotificationWhenHitThreshold", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DataVolumeCapStopSendNotificationWhenHitThreshold { get => _billingFeaturesPropertiesBody.DataVolumeCapStopSendNotificationWhenHitThreshold ?? default(global::System.Management.Automation.SwitchParameter); set => _billingFeaturesPropertiesBody.DataVolumeCapStopSendNotificationWhenHitThreshold = value; } + + /// Reserved, not used for now. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Reserved, not used for now.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reserved, not used for now.", + SerializedName = @"WarningThreshold", + PossibleTypes = new [] { typeof(int) })] + public int DataVolumeCapWarningThreshold { get => _billingFeaturesPropertiesBody.DataVolumeCapWarningThreshold ?? default(int); set => _billingFeaturesPropertiesBody.DataVolumeCapWarningThreshold = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentCurrentBillingFeaturesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentCurrentBillingFeaturesUpdate(ResourceGroupName, SubscriptionId, Name, _billingFeaturesPropertiesBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_billingFeaturesPropertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateExpanded.cs new file mode 100644 index 000000000000..684ce30ef5d3 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateExpanded.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Update the Continuous Export configuration for this export id. + /// + /// [OpenAPI] Update=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Set, @"AzApplicationInsightsContinuousExport_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Update the Continuous Export configuration for this export id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class SetAzApplicationInsightsContinuousExport_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// An Application Insights component Continuous Export configuration request definition. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest _exportPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportRequest(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The subscription ID of the destination storage container. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The subscription ID of the destination storage container.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The subscription ID of the destination storage container.", + SerializedName = @"DestinationStorageSubscriptionId", + PossibleTypes = new [] { typeof(string) })] + public string DestinationStorageSubscriptionId { get => _exportPropertiesBody.DestinationStorageSubscriptionId ?? null; set => _exportPropertiesBody.DestinationStorageSubscriptionId = value; } + + /// The Continuous Export destination type. This has to be 'Blob'. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Continuous Export destination type. This has to be 'Blob'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Continuous Export destination type. This has to be 'Blob'.", + SerializedName = @"DestinationType", + PossibleTypes = new [] { typeof(string) })] + public string DestinationType { get => _exportPropertiesBody.DestinationType ?? null; set => _exportPropertiesBody.DestinationType = value; } + + /// Backing field for property. + private string _exportId; + + /// + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Continuous Export configuration ID. This is unique within a Application Insights component.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Continuous Export configuration ID. This is unique within a Application Insights component.", + SerializedName = @"exportId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ExportId { get => this._exportId; set => this._exportId = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'.", + SerializedName = @"IsEnabled", + PossibleTypes = new [] { typeof(string) })] + public string IsEnabled { get => _exportPropertiesBody.IsEnabled ?? null; set => _exportPropertiesBody.IsEnabled = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Deprecated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Deprecated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Deprecated", + SerializedName = @"NotificationQueueEnabled", + PossibleTypes = new [] { typeof(string) })] + public string NotificationQueueEnabled { get => _exportPropertiesBody.NotificationQueueEnabled ?? null; set => _exportPropertiesBody.NotificationQueueEnabled = value; } + + /// Deprecated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Deprecated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Deprecated", + SerializedName = @"NotificationQueueUri", + PossibleTypes = new [] { typeof(string) })] + public string NotificationQueueUri { get => _exportPropertiesBody.NotificationQueueUri ?? null; set => _exportPropertiesBody.NotificationQueueUri = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', + /// 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'.", + SerializedName = @"RecordTypes", + PossibleTypes = new [] { typeof(string) })] + public string RecordType { get => _exportPropertiesBody.RecordType ?? null; set => _exportPropertiesBody.RecordType = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The name of destination storage account. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of destination storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of destination storage account.", + SerializedName = @"DestinationAccountId", + PossibleTypes = new [] { typeof(string) })] + public string StorageAccountId { get => _exportPropertiesBody.DestinationAccountId ?? null; set => _exportPropertiesBody.DestinationAccountId = value; } + + /// The location ID of the destination storage container. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The location ID of the destination storage container.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The location ID of the destination storage container.", + SerializedName = @"DestinationStorageLocationId", + PossibleTypes = new [] { typeof(string) })] + public string StorageLocation { get => _exportPropertiesBody.DestinationStorageLocationId ?? null; set => _exportPropertiesBody.DestinationStorageLocationId = value; } + + /// + /// The SAS URL for the destination storage container. It must grant write permission. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SAS URL for the destination storage container. It must grant write permission.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS URL for the destination storage container. It must grant write permission.", + SerializedName = @"DestinationAddress", + PossibleTypes = new [] { typeof(string) })] + public string StorageSASUri { get => _exportPropertiesBody.DestinationAddress ?? null; set => _exportPropertiesBody.DestinationAddress = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportConfigurationsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportConfigurationsUpdate(ResourceGroupName, SubscriptionId, Name, ExportId, _exportPropertiesBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,ExportId=ExportId,body=_exportPropertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public SetAzApplicationInsightsContinuousExport_UpdateExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsWebTest_UpdateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsWebTest_UpdateExpanded.cs new file mode 100644 index 000000000000..a57c2c75c755 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsWebTest_UpdateExpanded.cs @@ -0,0 +1,652 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Creates or updates an Application Insights web test definition. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Set, @"AzApplicationInsightsWebTest_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Creates or updates an Application Insights web test definition.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class SetAzApplicationInsightsWebTest_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// An Application Insights WebTest definition. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest _webTestDefinitionBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.WebTest(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// The XML specification of a WebTest to run against an application. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The XML specification of a WebTest to run against an application.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The XML specification of a WebTest to run against an application.", + SerializedName = @"WebTest", + PossibleTypes = new [] { typeof(string) })] + public string ConfigurationWebTest { get => _webTestDefinitionBody.ConfigurationWebTest ?? null; set => _webTestDefinitionBody.ConfigurationWebTest = value; } + + /// Content to look for in the return of the WebTest. Must not be null or empty. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Content to look for in the return of the WebTest. Must not be null or empty.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content to look for in the return of the WebTest. Must not be null or empty.", + SerializedName = @"ContentMatch", + PossibleTypes = new [] { typeof(string) })] + public string ContentValidationContentMatch { get => _webTestDefinitionBody.ContentValidationContentMatch ?? null; set => _webTestDefinitionBody.ContentValidationContentMatch = value; } + + /// When set, this value makes the ContentMatch validation case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When set, this value makes the ContentMatch validation case insensitive.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When set, this value makes the ContentMatch validation case insensitive.", + SerializedName = @"IgnoreCase", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ContentValidationIgnoreCase { get => _webTestDefinitionBody.ContentValidationIgnoreCase ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.ContentValidationIgnoreCase = value; } + + /// + /// When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there + /// is a match + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there is a match")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there is a match", + SerializedName = @"PassIfTextFound", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ContentValidationPassIfTextFound { get => _webTestDefinitionBody.ContentValidationPassIfTextFound ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.ContentValidationPassIfTextFound = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// User defined description for this WebTest. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User defined description for this WebTest.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User defined description for this WebTest.", + SerializedName = @"Description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _webTestDefinitionBody.Description ?? null; set => _webTestDefinitionBody.Description = value; } + + /// Is the test actively being monitored. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Is the test actively being monitored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Is the test actively being monitored.", + SerializedName = @"Enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter Enabled { get => _webTestDefinitionBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.Enabled = value; } + + /// Interval in seconds between test runs for this WebTest. Default value is 300. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Interval in seconds between test runs for this WebTest. Default value is 300.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Interval in seconds between test runs for this WebTest. Default value is 300.", + SerializedName = @"Frequency", + PossibleTypes = new [] { typeof(int) })] + public int Frequency { get => _webTestDefinitionBody.Frequency ?? default(int); set => _webTestDefinitionBody.Frequency = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The kind of WebTest that this web test watches. Choices are ping and multistep. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The kind of WebTest that this web test watches. Choices are ping and multistep.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of WebTest that this web test watches. Choices are ping and multistep.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind Kind { get => _webTestDefinitionBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind)""); set => _webTestDefinitionBody.Kind = value; } + + /// Resource location + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource location")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource location", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _webTestDefinitionBody.Location ?? null; set => _webTestDefinitionBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights WebTest resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights WebTest resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights WebTest resource.", + SerializedName = @"webTestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("WebTestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// A list of where to physically run the tests from to give global coverage for accessibility of your application. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A list of where to physically run the tests from to give global coverage for accessibility of your application.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of where to physically run the tests from to give global coverage for accessibility of your application.", + SerializedName = @"Locations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation[] PropertiesLocations { get => _webTestDefinitionBody.PropertiesLocations ?? null /* arrayOf */; set => _webTestDefinitionBody.PropertiesLocations = value; } + + /// User defined name if this WebTest. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User defined name if this WebTest.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User defined name if this WebTest.", + SerializedName = @"Name", + PossibleTypes = new [] { typeof(string) })] + public string PropertiesWebTestName { get => _webTestDefinitionBody.WebTestName ?? null; set => _webTestDefinitionBody.WebTestName = value; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Base64 encoded string body to send with this web test. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Base64 encoded string body to send with this web test.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Base64 encoded string body to send with this web test.", + SerializedName = @"RequestBody", + PossibleTypes = new [] { typeof(string) })] + public string RequestBody { get => _webTestDefinitionBody.RequestBody ?? null; set => _webTestDefinitionBody.RequestBody = value; } + + /// Follow redirects for this web test. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Follow redirects for this web test.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Follow redirects for this web test.", + SerializedName = @"FollowRedirects", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter RequestFollowRedirect { get => _webTestDefinitionBody.RequestFollowRedirect ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.RequestFollowRedirect = value; } + + /// List of headers and their values to add to the WebTest call. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of headers and their values to add to the WebTest call.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of headers and their values to add to the WebTest call.", + SerializedName = @"Headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField[] RequestHeader { get => _webTestDefinitionBody.RequestHeader ?? null /* arrayOf */; set => _webTestDefinitionBody.RequestHeader = value; } + + /// Http verb to use for this web test. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Http verb to use for this web test.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Http verb to use for this web test.", + SerializedName = @"HttpVerb", + PossibleTypes = new [] { typeof(string) })] + public string RequestHttpVerb { get => _webTestDefinitionBody.RequestHttpVerb ?? null; set => _webTestDefinitionBody.RequestHttpVerb = value; } + + /// Parse Dependent request for this WebTest. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Parse Dependent request for this WebTest.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parse Dependent request for this WebTest.", + SerializedName = @"ParseDependentRequests", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter RequestParseDependentRequest { get => _webTestDefinitionBody.RequestParseDependentRequest ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.RequestParseDependentRequest = value; } + + /// Url location to test. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Url location to test.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Url location to test.", + SerializedName = @"RequestUrl", + PossibleTypes = new [] { typeof(string) })] + public string RequestUrl { get => _webTestDefinitionBody.RequestUrl ?? null; set => _webTestDefinitionBody.RequestUrl = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Allow for retries should this WebTest fail. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow for retries should this WebTest fail.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow for retries should this WebTest fail.", + SerializedName = @"RetryEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter RetryEnabled { get => _webTestDefinitionBody.RetryEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.RetryEnabled = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Unique ID of this WebTest. This is typically the same value as the Name field. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unique ID of this WebTest. This is typically the same value as the Name field.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique ID of this WebTest. This is typically the same value as the Name field.", + SerializedName = @"SyntheticMonitorId", + PossibleTypes = new [] { typeof(string) })] + public string SyntheticMonitorId { get => _webTestDefinitionBody.SyntheticMonitorId ?? null; set => _webTestDefinitionBody.SyntheticMonitorId = value; } + + /// Resource tags + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags Tag { get => _webTestDefinitionBody.Tag ?? null /* object */; set => _webTestDefinitionBody.Tag = value; } + + /// Seconds until this WebTest will timeout and fail. Default value is 30. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Seconds until this WebTest will timeout and fail. Default value is 30.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Seconds until this WebTest will timeout and fail. Default value is 30.", + SerializedName = @"Timeout", + PossibleTypes = new [] { typeof(int) })] + public int Timeout { get => _webTestDefinitionBody.Timeout ?? default(int); set => _webTestDefinitionBody.Timeout = value; } + + /// Validate that the WebTest returns the http status code provided. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Validate that the WebTest returns the http status code provided.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Validate that the WebTest returns the http status code provided.", + SerializedName = @"ExpectedHttpStatusCode", + PossibleTypes = new [] { typeof(int) })] + public int ValidationRuleExpectedHttpStatusCode { get => _webTestDefinitionBody.ValidationRuleExpectedHttpStatusCode ?? default(int); set => _webTestDefinitionBody.ValidationRuleExpectedHttpStatusCode = value; } + + /// When set, validation will ignore the status code. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When set, validation will ignore the status code.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When set, validation will ignore the status code.", + SerializedName = @"IgnoreHttpsStatusCode", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ValidationRuleIgnoreHttpsStatusCode { get => _webTestDefinitionBody.ValidationRuleIgnoreHttpsStatusCode ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.ValidationRuleIgnoreHttpsStatusCode = value; } + + /// + /// A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck + /// must be set to true. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck must be set to true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck must be set to true.", + SerializedName = @"SSLCertRemainingLifetimeCheck", + PossibleTypes = new [] { typeof(int) })] + public int ValidationRuleSslCertRemainingLifetimeCheck { get => _webTestDefinitionBody.ValidationRuleSslCertRemainingLifetimeCheck ?? default(int); set => _webTestDefinitionBody.ValidationRuleSslCertRemainingLifetimeCheck = value; } + + /// Checks to see if the SSL cert is still valid. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Checks to see if the SSL cert is still valid.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Checks to see if the SSL cert is still valid.", + SerializedName = @"SSLCheck", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ValidationRuleSslCheck { get => _webTestDefinitionBody.ValidationRuleSslCheck ?? default(global::System.Management.Automation.SwitchParameter); set => _webTestDefinitionBody.ValidationRuleSslCheck = value; } + + /// The kind of web test this is, valid choices are ping, multistep, and standard. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The kind of web test this is, valid choices are ping, multistep, and standard.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The kind of web test this is, valid choices are ping, multistep, and standard.", + SerializedName = @"Kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum WebTestKind { get => _webTestDefinitionBody.WebTestKind ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum)""); set => _webTestDefinitionBody.WebTestKind = value; } + + /// + /// 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WebTestsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.WebTestsCreateOrUpdate(ResourceGroupName, SubscriptionId, Name, _webTestDefinitionBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_webTestDefinitionBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public SetAzApplicationInsightsWebTest_UpdateExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// 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 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.ApplicationInsights.Models.Api20180501Preview.IWebTest + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateExpanded.cs new file mode 100644 index 000000000000..356f2a79163c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateExpanded.cs @@ -0,0 +1,632 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// nor AppId in the Put operation. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Set, @"AzApplicationInsights_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// An Application Insights component definition. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent _insightPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent(); + + /// Type of application being monitored. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of application being monitored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of application being monitored.", + SerializedName = @"Application_Type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType ApplicationType { get => _insightPropertiesBody.ApplicationType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType)""); set => _insightPropertiesBody.ApplicationType = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Disable IP masking. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Disable IP masking.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disable IP masking.", + SerializedName = @"DisableIpMasking", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableIPMasking { get => _insightPropertiesBody.DisableIPMasking ?? default(global::System.Management.Automation.SwitchParameter); set => _insightPropertiesBody.DisableIPMasking = value; } + + /// Disable Non-AAD based Auth. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Disable Non-AAD based Auth.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Disable Non-AAD based Auth.", + SerializedName = @"DisableLocalAuth", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAuth { get => _insightPropertiesBody.DisableLocalAuth ?? default(global::System.Management.Automation.SwitchParameter); set => _insightPropertiesBody.DisableLocalAuth = value; } + + /// Resource etag + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource etag")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource etag", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _insightPropertiesBody.Etag ?? null; set => _insightPropertiesBody.Etag = value; } + + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.", + SerializedName = @"Flow_Type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType FlowType { get => _insightPropertiesBody.FlowType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType)""); set => _insightPropertiesBody.FlowType = value; } + + /// Force users to create their own storage account for profiler and debugger. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Force users to create their own storage account for profiler and debugger.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Force users to create their own storage account for profiler and debugger.", + SerializedName = @"ForceCustomerStorageForProfiler", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ForceCustomerStorageForProfiler { get => _insightPropertiesBody.ForceCustomerStorageForProfiler ?? default(global::System.Management.Automation.SwitchParameter); set => _insightPropertiesBody.ForceCustomerStorageForProfiler = value; } + + /// + /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp.", + SerializedName = @"HockeyAppId", + PossibleTypes = new [] { typeof(string) })] + public string HockeyAppId { get => _insightPropertiesBody.HockeyAppId ?? null; set => _insightPropertiesBody.HockeyAppId = 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Purge data immediately after 30 days. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Purge data immediately after 30 days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Purge data immediately after 30 days.", + SerializedName = @"ImmediatePurgeDataOn30Days", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ImmediatePurgeDataOn30Day { get => _insightPropertiesBody.ImmediatePurgeDataOn30Day ?? default(global::System.Management.Automation.SwitchParameter); set => _insightPropertiesBody.ImmediatePurgeDataOn30Day = value; } + + /// Indicates the flow of the ingestion. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates the flow of the ingestion.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the flow of the ingestion.", + SerializedName = @"IngestionMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode IngestionMode { get => _insightPropertiesBody.IngestionMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode)""); set => _insightPropertiesBody.IngestionMode = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should + /// typically be one of the following: web, ios, other, store, java, phone. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + public string Kind { get => _insightPropertiesBody.Kind ?? null; set => _insightPropertiesBody.Kind = value; } + + /// Resource location + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource location")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource location", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _insightPropertiesBody.Location ?? null; set => _insightPropertiesBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The network access type for accessing Application Insights ingestion. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The network access type for accessing Application Insights ingestion.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network access type for accessing Application Insights ingestion.", + SerializedName = @"publicNetworkAccessForIngestion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType PublicNetworkAccessForIngestion { get => _insightPropertiesBody.PublicNetworkAccessForIngestion ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType)""); set => _insightPropertiesBody.PublicNetworkAccessForIngestion = value; } + + /// The network access type for accessing Application Insights query. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The network access type for accessing Application Insights query.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network access type for accessing Application Insights query.", + SerializedName = @"publicNetworkAccessForQuery", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType PublicNetworkAccessForQuery { get => _insightPropertiesBody.PublicNetworkAccessForQuery ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType)""); set => _insightPropertiesBody.PublicNetworkAccessForQuery = value; } + + /// + /// Describes what tool created this Application Insights component. Customers using this API should set this to the default + /// 'rest'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.", + SerializedName = @"Request_Source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource))] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource RequestSource { get => _insightPropertiesBody.RequestSource ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource)""); set => _insightPropertiesBody.RequestSource = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Retention period in days. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Retention period in days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Retention period in days.", + SerializedName = @"RetentionInDays", + PossibleTypes = new [] { typeof(int) })] + public int RetentionInDay { get => _insightPropertiesBody.RetentionInDay ?? default(int); set => _insightPropertiesBody.RetentionInDay = value; } + + /// + /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry.", + SerializedName = @"SamplingPercentage", + PossibleTypes = new [] { typeof(double) })] + public double SamplingPercentage { get => _insightPropertiesBody.SamplingPercentage ?? default(double); set => _insightPropertiesBody.SamplingPercentage = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Resource tags + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags Tag { get => _insightPropertiesBody.Tag ?? null /* object */; set => _insightPropertiesBody.Tag = value; } + + /// + /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an + /// application with this API version. Applications from older versions will not have this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an application with this API version. Applications from older versions will not have this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an application with this API version. Applications from older versions will not have this property.", + SerializedName = @"WorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string WorkspaceResourceId { get => _insightPropertiesBody.WorkspaceResourceId ?? null; set => _insightPropertiesBody.WorkspaceResourceId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsCreateOrUpdate(ResourceGroupName, SubscriptionId, Name, _insightPropertiesBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_insightPropertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public SetAzApplicationInsights_UpdateExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_insightPropertiesBody }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_insightPropertiesBody }) + { + 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 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateExpanded.cs new file mode 100644 index 000000000000..ab500cfcfc4e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateExpanded.cs @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + /// + /// + /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsComponentTag_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Updates an existing component's tags. To update other fields use the CreateOrUpdate method.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class UpdateAzApplicationInsightsComponentTag_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource _componentTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.TagsResource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Resource tags + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags Tag { get => _componentTagsBody.Tag ?? null /* object */; set => _componentTagsBody.Tag = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentsUpdateTags' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentsUpdateTags(ResourceGroupName, SubscriptionId, Name, _componentTagsBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_componentTagsBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzApplicationInsightsComponentTag_UpdateExpanded() + { + + } + + /// + /// 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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_componentTagsBody }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_componentTagsBody }) + { + 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 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..3728e5092970 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded.cs @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// + /// Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + /// + /// + /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsComponentTag_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Updates an existing component's tags. To update other fields use the CreateOrUpdate method.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource _componentTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.TagsResource(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = 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.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resource tags + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags Tag { get => _componentTagsBody.Tag ?? null /* object */; set => _componentTagsBody.Tag = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentsUpdateTags' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentsUpdateTagsViaIdentity(InputObject.Id, _componentTagsBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentsUpdateTags(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, _componentTagsBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_componentTagsBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded() + { + + } + + /// + /// 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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_componentTagsBody }) + { + 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 { body=_componentTagsBody }) + { + 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 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.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded.cs new file mode 100644 index 000000000000..6ace0f2b078a --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded.cs @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Update linked storage accounts for an Application Insights component. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsLinkedStorageAccount_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Update linked storage accounts for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// An Application Insights component linked storage accounts patch + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch _linkedStorageAccountsPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ComponentLinkedStorageAccountsPatch(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Linked storage account resource ID + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Linked storage account resource ID")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Linked storage account resource ID", + SerializedName = @"linkedStorageAccount", + PossibleTypes = new [] { typeof(string) })] + public string LinkedStorageAccountResourceId { get => _linkedStorageAccountsPropertiesBody.LinkedStorageAccount ?? null; set => _linkedStorageAccountsPropertiesBody.LinkedStorageAccount = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Application Insights component resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Application Insights component resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Application Insights component resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ApplicationInsightsComponentName", "ComponentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentLinkedStorageAccountsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ComponentLinkedStorageAccountsUpdate(ResourceGroupName, SubscriptionId, Name, _linkedStorageAccountsPropertiesBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_linkedStorageAccountsPropertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded() + { + + } + + /// + /// 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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_linkedStorageAccountsPropertiesBody }) + { + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_linkedStorageAccountsPropertiesBody }) + { + 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 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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..b5666dae3f7d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded.cs @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using System; + + /// Update linked storage accounts for an Application Insights component. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Update linked storage accounts for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + { + /// 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 for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// An Application Insights component linked storage accounts patch + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch _linkedStorageAccountsPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ComponentLinkedStorageAccountsPatch(); + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Linked storage account resource ID + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Linked storage account resource ID")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Linked storage account resource ID", + SerializedName = @"linkedStorageAccount", + PossibleTypes = new [] { typeof(string) })] + public string LinkedStorageAccountResourceId { get => _linkedStorageAccountsPropertiesBody.LinkedStorageAccount ?? null; set => _linkedStorageAccountsPropertiesBody.LinkedStorageAccount = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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 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 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.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.ApplicationInsights.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.ApplicationInsights.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ComponentLinkedStorageAccountsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ComponentLinkedStorageAccountsUpdateViaIdentity(InputObject.Id, _linkedStorageAccountsPropertiesBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ComponentLinkedStorageAccountsUpdate(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, _linkedStorageAccountsPropertiesBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_linkedStorageAccountsPropertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded() + { + + } + + /// + /// 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 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.ApplicationInsights.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_linkedStorageAccountsPropertiesBody }) + { + 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 { body=_linkedStorageAccountsPropertiesBody }) + { + 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 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.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateExpanded.cs index eaed9f5be690..c17d7d7cb5cb 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateExpanded.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateExpanded.cs @@ -33,6 +33,11 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateExpanded : glob /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// + /// A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource _webTestTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.TagsResource(); + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] @@ -66,11 +71,11 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateExpanded : glob public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// - /// cancellation delegate. Stops the cmdlet when called. + /// cancellation delegate. Stops the cmdlet when called. /// global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// cancellation token. + /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// Backing field for property. @@ -150,15 +155,7 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateExpanded : glob Description = @"Resource tags", SerializedName = @"tags", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags Tag { get => WebTestTagsBody.Tag ?? null /* object */; set => WebTestTagsBody.Tag = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource _webTestTagsBody= new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.TagsResource(); - - /// - /// A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. - /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource WebTestTagsBody { get => this._webTestTagsBody; set => this._webTestTagsBody = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags Tag { get => _webTestTagsBody.Tag ?? null /* object */; set => _webTestTagsBody.Tag = value; } /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -177,6 +174,11 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateExpanded : glob /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -188,7 +190,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -291,7 +293,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) @@ -306,12 +307,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WebTestsUpdateTags(ResourceGroupName, SubscriptionId, Name, WebTestTagsBody, onOk, this, Pipeline); + await this.Client.WebTestsUpdateTags(ResourceGroupName, SubscriptionId, Name, _webTestTagsBody, onOk, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=WebTestTagsBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId,Name=Name,body=_webTestTagsBody}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded.cs index 5da78284b60f..6d0cc03b3830 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded.cs @@ -33,6 +33,11 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpa /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// + /// A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource _webTestTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.TagsResource(); + /// 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.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] @@ -74,11 +79,11 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpa public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// - /// cancellation delegate. Stops the cmdlet when called. + /// cancellation delegate. Stops the cmdlet when called. /// global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - /// cancellation token. + /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// @@ -112,15 +117,7 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpa Description = @"Resource tags", SerializedName = @"tags", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags Tag { get => WebTestTagsBody.Tag ?? null /* object */; set => WebTestTagsBody.Tag = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource _webTestTagsBody= new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.TagsResource(); - - /// - /// A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. - /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResource WebTestTagsBody { get => this._webTestTagsBody; set => this._webTestTagsBody = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags Tag { get => _webTestTagsBody.Tag ?? null /* object */; set => _webTestTagsBody.Tag = value; } /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -139,6 +136,11 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpa /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -150,7 +152,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -253,7 +255,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) @@ -270,7 +271,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.WebTestsUpdateTagsViaIdentity(InputObject.Id, WebTestTagsBody, onOk, this, Pipeline); + await this.Client.WebTestsUpdateTagsViaIdentity(InputObject.Id, _webTestTagsBody, onOk, this, Pipeline); } else { @@ -287,13 +288,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WebTestName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.WebTestsUpdateTags(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.WebTestName ?? null, WebTestTagsBody, onOk, this, Pipeline); + await this.Client.WebTestsUpdateTags(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.WebTestName ?? null, _webTestTagsBody, onOk, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=WebTestTagsBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_webTestTagsBody}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs index 23278ae2766b..1d9c1cc5980e 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs @@ -52,6 +52,17 @@ public override string ToString() internal class HelpExampleOutput { + private string ExampleTemplate = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + Environment.NewLine; + + private string ExampleTemplateWithOutput = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + "{6}" + Environment.NewLine + "{7}" + Environment.NewLine + Environment.NewLine + + "{8}" + Environment.NewLine + Environment.NewLine; + public MarkdownExampleHelpInfo ExampleInfo { get; } public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo) @@ -59,17 +70,26 @@ public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo) ExampleInfo = exampleInfo; } - public override string ToString() => $@"{ExampleNameHeader}{ExampleInfo.Name} -{ExampleCodeHeader} -{ExampleInfo.Code} -{ExampleCodeFooter} - -{ExampleInfo.Description.ToDescriptionFormat()} - -"; + public override string ToString() + { + if (string.IsNullOrEmpty(ExampleInfo.Output)) + { + return string.Format(ExampleTemplate, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleInfo.Description.ToDescriptionFormat()); + } + else + { + return string.Format(ExampleTemplateWithOutput, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleOutputHeader, ExampleInfo.Output, ExampleOutputFooter, + ExampleInfo.Description.ToDescriptionFormat()); ; + } + } } - - + internal class HelpParameterOutput { public MarkdownParameterHelpInfo ParameterInfo { get; } @@ -161,6 +181,8 @@ public static string ToDescriptionFormat(this string text, bool escapeAngleBrack public const string ExampleNameHeader = "### "; public const string ExampleCodeHeader = "```powershell"; public const string ExampleCodeFooter = "```"; + public const string ExampleOutputHeader = "```output"; + public const string ExampleOutputFooter = "```"; public static HelpMetadataOutput ToHelpMetadataOutput(this MarkdownHelpInfo helpInfo) => new HelpMetadataOutput(helpInfo); diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index ceed1a09b6dd..1b2368e73313 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -109,18 +109,21 @@ internal class PsHelpExampleInfo { public string Title { get; } public string Code { get; } + public string Output { get; } public string Remarks { get; } public PsHelpExampleInfo(PSObject exampleObject) { Title = exampleObject.GetProperty("title"); Code = exampleObject.GetProperty("code"); + Output = exampleObject.GetProperty("output"); Remarks = exampleObject.GetProperty("remarks").EmptyIfNull().ToDescriptionText(); } public PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) { Title = markdownExample.Name; Code = markdownExample.Code; + Output = markdownExample.Output; Remarks = markdownExample.Description; } diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 6ae78c2cc02f..746334b8f34f 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -39,7 +39,7 @@ internal class MarkdownHelpInfo public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string externalHelpFilename = "") { ExternalHelpFilename = externalHelpFilename; - ModuleName = variantGroup.ModuleName; + ModuleName = variantGroup.RootModuleName != "" ? variantGroup.RootModuleName : variantGroup.ModuleName; var helpInfo = variantGroup.HelpInfo; var commentInfo = variantGroup.CommentInfo; Schema = Version.Parse("2.0.0"); @@ -91,12 +91,17 @@ private MarkdownExampleHelpInfo[] GetExamplesFromMarkdown(string examplesFolder) var code = codeStartIndex.HasValue && codeEndIndex.HasValue ? String.Join(Environment.NewLine, eg.Skip(codeStartIndex.Value + 1).Take(codeEndIndex.Value - (codeStartIndex.Value + 1))) : String.Empty; - var descriptionStartIndex = (codeEndIndex ?? 0) + 1; + var outputStartIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var outputEndIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i > outputStartIndex); + var output = outputStartIndex.HasValue && outputEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(outputStartIndex.Value + 1).Take(outputEndIndex.Value - (outputStartIndex.Value + 1))) + : String.Empty; + var descriptionStartIndex = (outputEndIndex ?? (codeEndIndex ?? 0)) + 1; descriptionStartIndex = String.IsNullOrWhiteSpace(eg[descriptionStartIndex]) ? descriptionStartIndex + 1 : descriptionStartIndex; var descriptionEndIndex = eg.Length - 1; descriptionEndIndex = String.IsNullOrWhiteSpace(eg[descriptionEndIndex]) ? descriptionEndIndex - 1 : descriptionEndIndex; var description = String.Join(Environment.NewLine, eg.Skip(descriptionStartIndex).Take((descriptionEndIndex + 1) - descriptionStartIndex)); - return new MarkdownExampleHelpInfo(name, code, description); + return new MarkdownExampleHelpInfo(name, code, output, description); }).ToArray(); } } @@ -154,12 +159,14 @@ internal class MarkdownExampleHelpInfo { public string Name { get; } public string Code { get; } + public string Output { get; } public string Description { get; } - public MarkdownExampleHelpInfo(string name, string code, string description) + public MarkdownExampleHelpInfo(string name, string code, string output, string description) { Name = name; Code = code; + Output = output; Description = description; } } @@ -213,12 +220,12 @@ public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, Param internal static class MarkdownTypesExtensions { - public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Remarks); + public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = { - new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"PS C:\> {{{{ Add code here }}}}{Environment.NewLine}{Environment.NewLine}{{{{ Add output here }}}}", @"{{ Add description here }}"), - new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"PS C:\> {{{{ Add code here }}}}{Environment.NewLine}{Environment.NewLine}{{{{ Add output here }}}}", @"{{ Add description here }}") + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), }; public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index b3dbe0bb42aa..a2363d900d2d 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -168,19 +168,56 @@ public ParameterNameOutput(string parameterName, bool isLast) public override string ToString() => $"{Indent}${{{ParameterName}}}{(IsLast ? String.Empty : $",{Environment.NewLine}")}{Environment.NewLine}"; } - internal class BeginOutput + internal class BaseOutput { public VariantGroup VariantGroup { get; } - public BeginOutput(VariantGroup variantGroup) + protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; } + public string ClearTelemetryContext() + { + return (!VariantGroup.IsInternal && IsAzure) ? $@"{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()" : ""; + } + } + + internal class BeginOutput : BaseOutput + { + public BeginOutput(VariantGroup variantGroup) : base(variantGroup) + { + } public string GetProcessCustomAttributesAtRuntime() { return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() +{Indent}{Indent}}} +{Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}{Indent}if ($internalCalledCmdlets -eq '') {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' +{Indent}{Indent}}} +"; + } + return ""; + } public override string ToString() => $@"begin {{ {Indent}try {{ {Indent}{Indent}$outBuffer = $null @@ -188,6 +225,7 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName +{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -195,6 +233,7 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) {Indent}}} catch {{ +{ClearTelemetryContext()} {Indent}{Indent}throw {Indent}}} }} @@ -231,28 +270,69 @@ private string GetDefaultValuesStatements() } } - internal class ProcessOutput + internal class ProcessOutput : BaseOutput { + public ProcessOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetFinally() + { + if (IsAzure && !VariantGroup.IsInternal) + { + return $@" +{Indent}finally {{ +{Indent}{Indent}$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}}} +"; + } + return ""; + } public override string ToString() => $@"process {{ {Indent}try {{ {Indent}{Indent}$steppablePipeline.Process($_) {Indent}}} catch {{ +{ClearTelemetryContext()} {Indent}{Indent}throw {Indent}}} +{GetFinally()} }} - "; } - internal class EndOutput + internal class EndOutput : BaseOutput { + public EndOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}{Indent}}} +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId +"; + } + return ""; + } public override string ToString() => $@"end {{ {Indent}try {{ {Indent}{Indent}$steppablePipeline.End() +{GetTelemetry()} {Indent}}} catch {{ +{ClearTelemetryContext()} {Indent}{Indent}throw {Indent}}} -}} +}} "; } @@ -493,9 +573,9 @@ public static string ToSyntaxTypeName(this Type type) public static BeginOutput ToBeginOutput(this VariantGroup variantGroup) => new BeginOutput(variantGroup); - public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(); + public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(variantGroup); - public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(); + public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(variantGroup); public static HelpCommentOutput ToHelpCommentOutput(this VariantGroup variantGroup) => new HelpCommentOutput(variantGroup); diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index e623e30ba7b9..f9e9a3f9dc3f 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -30,6 +30,8 @@ public ProfileGroup(Variant[] variants, string profileName = NoProfiles) internal class VariantGroup { public string ModuleName { get; } + + public string RootModuleName {get => @"";} public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -385,7 +387,9 @@ public CommentInfo(VariantGroup variantGroup) helpInfo.OutputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(ot => ot.Name).ToArray()) .Where(o => o != "None").Distinct().OrderBy(o => o).ToArray(); - OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{variantGroup.ModuleName.ToLowerInvariant()}/{variantGroup.CmdletName.ToLowerInvariant()}"; + // Use root module name in the help link + var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); + OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); } } diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Clear-AzApplicationInsights.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Clear-AzApplicationInsights.ps1 new file mode 100644 index 000000000000..505f437b971b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Clear-AzApplicationInsights.ps1 @@ -0,0 +1,227 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, purge requests are throttled at 50 requests per hour. +You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. +Use the in operator to specify multiple identities. +You should run the query prior to using for a purge request to verify that the results are expected. +.Description +Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, purge requests are throttled at 50 requests per hour. +You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. +Use the in operator to specify multiple identities. +You should run the query prior to using for a purge request to verify that the results are expected. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +System.String +.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. + +BODY : Describes the body of a purge request for an App Insights component + Filter : The set of columns and filters (queries) to run over them to purge the resulting data. + [Column ]: The column of the table over which the given query should run + [Key ]: When filtering over custom dimensions, this key will be used as the name of the custom dimension. + [Operator ]: A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query. + [Value ]: the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. + Table : Table from which to purge data. + +FILTER : The set of columns and filters (queries) to run over them to purge the resulting data. + [Column ]: The column of the table over which the given query should run + [Key ]: When filtering over custom dimensions, this key will be used as the name of the custom dimension. + [Operator ]: A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query. + [Value ]: the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. + +INPUTOBJECT : Identity Parameter + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/clear-azapplicationinsights +#> +function Clear-AzApplicationInsights { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='PurgeViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Purge', Mandatory)] + [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Purge', Mandatory)] + [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Purge')] + [Parameter(ParameterSetName='PurgeExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='PurgeViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PurgeViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Purge', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PurgeViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody] + # Describes the body of a purge request for an App Insights component + # To construct, see NOTES section for BODY properties and create a hash table. + ${Body}, + + [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Parameter(ParameterSetName='PurgeViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters[]] + # The set of columns and filters (queries) to run over them to purge the resulting data. + # To construct, see NOTES section for FILTER properties and create a hash table. + ${Filter}, + + [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Parameter(ParameterSetName='PurgeViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Table from which to purge data. + ${Table}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Purge = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_Purge'; + PurgeExpanded = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_PurgeExpanded'; + PurgeViaIdentity = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_PurgeViaIdentity'; + PurgeViaIdentityExpanded = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_PurgeViaIdentityExpanded'; + } + if (('Purge', 'PurgeExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsights.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsights.ps1 new file mode 100644 index 000000000000..7a978db9be1e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsights.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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns an Application Insights component. +.Description +Returns an Application Insights component. +.Example +PS C:\> Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" +.Example +PS C:\> Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePricingPlan + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsights +#> +function Get-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsights_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsights_GetViaIdentity'; + List = 'Az.ApplicationInsights.private\Get-AzApplicationInsights_List'; + List1 = 'Az.ApplicationInsights.private\Get-AzApplicationInsights_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsAnnotation.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsAnnotation.ps1 new file mode 100644 index 000000000000..a6e0400608c5 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsAnnotation.ps1 @@ -0,0 +1,198 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Get the annotation for given id. +.Description +Get the annotation for given id. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsannotation +#> +function Get-AzApplicationInsightsAnnotation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('AnnotationId')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The unique annotation ID. + # This is unique within a Application Insights component. + ${Id}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] + [System.String] + # The end time to query for annotations. + ${End}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] + [System.String] + # The start time to query from for annotations, cannot be older than 90 days from current date. + ${Start}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_GetViaIdentity'; + List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentAvailableFeature.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentAvailableFeature.ps1 new file mode 100644 index 000000000000..cf726b3df38c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentAvailableFeature.ps1 @@ -0,0 +1,175 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Returns all available features of the application insights component. +.Description +Returns all available features of the application insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentavailablefeature +#> +function Get-AzApplicationInsightsComponentAvailableFeature { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentAvailableFeature_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentAvailableFeature_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentCurrentBillingFeature.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentCurrentBillingFeature.ps1 new file mode 100644 index 000000000000..d634ad07a2aa --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentCurrentBillingFeature.ps1 @@ -0,0 +1,175 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Returns current billing features for an Application Insights component. +.Description +Returns current billing features for an Application Insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentcurrentbillingfeature +#> +function Get-AzApplicationInsightsComponentCurrentBillingFeature { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentCurrentBillingFeature_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentFeatureCapability.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentFeatureCapability.ps1 new file mode 100644 index 000000000000..7a569ea2c4a6 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentFeatureCapability.ps1 @@ -0,0 +1,175 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Returns feature capabilities of the application insights component. +.Description +Returns feature capabilities of the application insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentfeaturecapability +#> +function Get-AzApplicationInsightsComponentFeatureCapability { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentFeatureCapability_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentFeatureCapability_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentPurgeStatus.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentPurgeStatus.ps1 new file mode 100644 index 000000000000..66af09724587 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentPurgeStatus.ps1 @@ -0,0 +1,181 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Get status for an ongoing purge operation. +.Description +Get status for an ongoing purge operation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentpurgestatus +#> +function Get-AzApplicationInsightsComponentPurgeStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # In a purge status request, this is the Id of the operation the status of which is returned. + ${PurgeId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentPurgeStatus_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentPurgeStatus_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentQuotaStatus.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentQuotaStatus.ps1 new file mode 100644 index 000000000000..14112207e0c8 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentQuotaStatus.ps1 @@ -0,0 +1,175 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Returns daily data volume cap (quota) status for an Application Insights component. +.Description +Returns daily data volume cap (quota) status for an Application Insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentquotastatus +#> +function Get-AzApplicationInsightsComponentQuotaStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentQuotaStatus_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentQuotaStatus_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsOperation.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsOperation.ps1 index 060c221302ba..4d73b31c9235 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsOperation.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsOperation.ps1 @@ -20,21 +20,19 @@ List the available operations supported by the Microsoft.EventGrid resource prov .Description List the available operations supported by the Microsoft.EventGrid resource provider. .Example -PS C:\> {{ Add code here }} - -{{ Add output here }} +{{ Add code here }} .Example -PS C:\> {{ Add code here }} - -{{ Add output here }} +{{ Add code here }} +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated .Outputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IOperation .Link https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsoperation #> function Get-AzApplicationInsightsOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IOperation], [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -65,7 +63,7 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, - [Parameter()] + [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds @@ -98,8 +96,10 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsOperation_List'; + List1 = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsOperation_List1'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -107,6 +107,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + throw } } @@ -115,15 +116,18 @@ process { try { $steppablePipeline.Process($_) } catch { + throw } -} +} end { try { $steppablePipeline.End() + } catch { + throw } -} +} } diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsights.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsights.ps1 new file mode 100644 index 000000000000..b54e9f41dc97 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsights.ps1 @@ -0,0 +1,268 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Description +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Example +PS C:\> New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights +#> +function New-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The kind of application that this component refers to, used to customize UI. + # This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. + ${Kind}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource location + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + # Type of application being monitored. + ${ApplicationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable IP masking. + ${DisableIPMasking}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable Non-AAD based Auth. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource etag + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + # Used by the Application Insights system to determine what kind of flow this component was created by. + # This is to be set to 'Bluefield' when creating/updating a component via the REST API. + ${FlowType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Force users to create their own storage account for profiler and debugger. + ${ForceCustomerStorageForProfiler}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + ${HockeyAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Purge data immediately after 30 days. + ${ImmediatePurgeDataOn30Day}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + # Indicates the flow of the ingestion. + ${IngestionMode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights ingestion. + ${PublicNetworkAccessForIngestion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights query. + ${PublicNetworkAccessForQuery}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + # Describes what tool created this Application Insights component. + # Customers using this API should set this to the default 'rest'. + ${RequestSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Retention period in days. + ${RetentionInDay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + ${SamplingPercentage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource Id of the log analytics workspace which the data will be ingested to. + # This property is required to create an application with this API version. + # Applications from older versions will not have this property. + ${WorkspaceResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsAnnotation.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsAnnotation.ps1 new file mode 100644 index 000000000000..d140f7f01767 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsAnnotation.ps1 @@ -0,0 +1,183 @@ + +# ---------------------------------------------------------------------------------- +# 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 Annotation of an Application Insights component. +.Description +Create an Annotation of an Application Insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsannotation +#> +function New-AzApplicationInsightsAnnotation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Name of annotation + ${AnnotationName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Category of annotation, free form + ${Category}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.DateTime] + # Time when event occurred + ${EventTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Unique Id for annotation + ${Id}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Serialized JSON object for detailed properties + ${Property}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Related parent annotation if any + ${RelatedAnnotation}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsApiKey.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsApiKey.ps1 new file mode 100644 index 000000000000..fab490001782 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsApiKey.ps1 @@ -0,0 +1,169 @@ + +# ---------------------------------------------------------------------------------- +# 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 API Key of an Application Insights component. +.Description +Create an API Key of an Application Insights component. +.Example +PS C:\> $apiKeyDescription = "testapiKey" +PS C:\> $permissions = @("ReadTelemetry", "WriteAnnotations") +PS C:\> New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Description $apiKeyDescription -Permissions $permissions + + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsapikey +#> +function New-AzApplicationInsightsApiKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of the API Key. + ${Description}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # The read access rights of this API Key. + ${LinkedReadProperty}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # The write access rights of this API Key. + ${LinkedWriteProperty}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsApiKey_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsContinuousExport.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsContinuousExport.ps1 new file mode 100644 index 000000000000..35cd8f99c71c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsContinuousExport.ps1 @@ -0,0 +1,207 @@ + +# ---------------------------------------------------------------------------------- +# 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 a Continuous Export configuration of an Application Insights component. +.Description +Create a Continuous Export configuration of an Application Insights component. +.Example +PS C:\> $sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +PS C:\> $sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +PS C:\> New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" ` +-DocumentType "Request","Trace", "Custom Event" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus ` +-StorageSASUri $sasuri + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport +#> +function New-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The subscription ID of the destination storage container. + ${DestinationStorageSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The Continuous Export destination type. + # This has to be 'Blob'. + ${DestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. + ${IsEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The document types to be exported, as comma separated values. + # Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + ${RecordType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of destination storage account. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The location ID of the destination storage container. + ${StorageLocation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The SAS URL for the destination storage container. + # It must grant write permission. + ${StorageSASUri}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsWebTest.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsWebTest.ps1 index 9abd8f06d56e..4ba00c257f28 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsWebTest.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsWebTest.ps1 @@ -20,35 +20,27 @@ Creates or updates an Application Insights web test definition. .Description Creates or updates an Application Insights web test definition. .Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroup azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'standard-pwsh01' ` -RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -standard-pwsh01 westus2 standard azpwsh-rg-test True .Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` -Kind 'ping' -RequestUrl 'https://cn.bing.com' -RequestParseDependent -RuleExpectedHttpStatusCode 200 ` -ContentMatch "status" - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True .Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` -GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` -Kind 'ping' ` @@ -68,10 +60,6 @@ PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name " -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True - .Outputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest .Notes @@ -323,6 +311,7 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWebTest_CreateExpanded'; } @@ -335,6 +324,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + throw } } @@ -343,15 +333,18 @@ process { try { $steppablePipeline.Process($_) } catch { + throw } -} +} end { try { $steppablePipeline.End() + } catch { + throw } -} +} } diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/ProxyCmdletDefinitions.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/ProxyCmdletDefinitions.ps1 index ffd942c8c956..82a5e92e7244 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -16,27 +16,3289 @@ <# .Synopsis +Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, purge requests are throttled at 50 requests per hour. +You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. +Use the in operator to specify multiple identities. +You should run the query prior to using for a purge request to verify that the results are expected. +.Description +Purges data in an Application Insights component by a set of user-defined filters.\n\nIn order to manage system resources, purge requests are throttled at 50 requests per hour. +You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. +Use the in operator to specify multiple identities. +You should run the query prior to using for a purge request to verify that the results are expected. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +System.String +.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. + +BODY : Describes the body of a purge request for an App Insights component + Filter : The set of columns and filters (queries) to run over them to purge the resulting data. + [Column ]: The column of the table over which the given query should run + [Key ]: When filtering over custom dimensions, this key will be used as the name of the custom dimension. + [Operator ]: A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query. + [Value ]: the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. + Table : Table from which to purge data. + +FILTER : The set of columns and filters (queries) to run over them to purge the resulting data. + [Column ]: The column of the table over which the given query should run + [Key ]: When filtering over custom dimensions, this key will be used as the name of the custom dimension. + [Operator ]: A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query. + [Value ]: the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. + +INPUTOBJECT : Identity Parameter + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/clear-azapplicationinsights +#> +function Clear-AzApplicationInsights { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='PurgeViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Purge', Mandatory)] + [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Purge', Mandatory)] + [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Purge')] + [Parameter(ParameterSetName='PurgeExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='PurgeViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PurgeViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Purge', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PurgeViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody] + # Describes the body of a purge request for an App Insights component + # To construct, see NOTES section for BODY properties and create a hash table. + ${Body}, + + [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Parameter(ParameterSetName='PurgeViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters[]] + # The set of columns and filters (queries) to run over them to purge the resulting data. + # To construct, see NOTES section for FILTER properties and create a hash table. + ${Filter}, + + [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Parameter(ParameterSetName='PurgeViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Table from which to purge data. + ${Table}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Purge = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_Purge'; + PurgeExpanded = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_PurgeExpanded'; + PurgeViaIdentity = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_PurgeViaIdentity'; + PurgeViaIdentityExpanded = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_PurgeViaIdentityExpanded'; + } + if (('Purge', 'PurgeExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Get the annotation for given id. +.Description +Get the annotation for given id. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsannotation +#> +function Get-AzApplicationInsightsAnnotation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('AnnotationId')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The unique annotation ID. + # This is unique within a Application Insights component. + ${Id}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] + [System.String] + # The end time to query for annotations. + ${End}, + + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] + [System.String] + # The start time to query from for annotations, cannot be older than 90 days from current date. + ${Start}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_GetViaIdentity'; + List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Returns all available features of the application insights component. +.Description +Returns all available features of the application insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentavailablefeature +#> +function Get-AzApplicationInsightsComponentAvailableFeature { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentAvailableFeature_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentAvailableFeature_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Returns current billing features for an Application Insights component. +.Description +Returns current billing features for an Application Insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentcurrentbillingfeature +#> +function Get-AzApplicationInsightsComponentCurrentBillingFeature { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentCurrentBillingFeature_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Returns feature capabilities of the application insights component. +.Description +Returns feature capabilities of the application insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentfeaturecapability +#> +function Get-AzApplicationInsightsComponentFeatureCapability { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentFeatureCapability_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentFeatureCapability_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Get status for an ongoing purge operation. +.Description +Get status for an ongoing purge operation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentpurgestatus +#> +function Get-AzApplicationInsightsComponentPurgeStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # In a purge status request, this is the Id of the operation the status of which is returned. + ${PurgeId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentPurgeStatus_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentPurgeStatus_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Returns daily data volume cap (quota) status for an Application Insights component. +.Description +Returns daily data volume cap (quota) status for an Application Insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentquotastatus +#> +function Get-AzApplicationInsightsComponentQuotaStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentQuotaStatus_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentQuotaStatus_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +List the available operations supported by the Microsoft.EventGrid resource provider. +.Description List the available operations supported by the Microsoft.EventGrid resource provider. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IOperation +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsoperation +#> +function Get-AzApplicationInsightsOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IOperation], [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IOperationAutoGenerated])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsOperation_List'; + List1 = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsOperation_List1'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Returns an Application Insights component. +.Description +Returns an Application Insights component. +.Example +PS C:\> Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" +.Example +PS C:\> Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePricingPlan + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsights +#> +function Get-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsights_Get'; + GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsights_GetViaIdentity'; + List = 'Az.ApplicationInsights.private\Get-AzApplicationInsights_List'; + List1 = 'Az.ApplicationInsights.private\Get-AzApplicationInsights_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Create an Annotation of an Application Insights component. +.Description +Create an Annotation of an Application Insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsannotation +#> +function New-AzApplicationInsightsAnnotation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Name of annotation + ${AnnotationName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Category of annotation, free form + ${Category}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.DateTime] + # Time when event occurred + ${EventTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Unique Id for annotation + ${Id}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Serialized JSON object for detailed properties + ${Property}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Related parent annotation if any + ${RelatedAnnotation}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Create an API Key of an Application Insights component. +.Description +Create an API Key of an Application Insights component. +.Example +PS C:\> $apiKeyDescription = "testapiKey" +PS C:\> $permissions = @("ReadTelemetry", "WriteAnnotations") +PS C:\> New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Description $apiKeyDescription -Permissions $permissions + + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsapikey +#> +function New-AzApplicationInsightsApiKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of the API Key. + ${Description}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # The read access rights of this API Key. + ${LinkedReadProperty}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # The write access rights of this API Key. + ${LinkedWriteProperty}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsApiKey_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Create a Continuous Export configuration of an Application Insights component. +.Description +Create a Continuous Export configuration of an Application Insights component. +.Example +PS C:\> $sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +PS C:\> $sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +PS C:\> New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" ` +-DocumentType "Request","Trace", "Custom Event" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus ` +-StorageSASUri $sasuri + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport +#> +function New-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The subscription ID of the destination storage container. + ${DestinationStorageSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The Continuous Export destination type. + # This has to be 'Blob'. + ${DestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. + ${IsEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The document types to be exported, as comma separated values. + # Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + ${RecordType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of destination storage account. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The location ID of the destination storage container. + ${StorageLocation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The SAS URL for the destination storage container. + # It must grant write permission. + ${StorageSASUri}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Creates or updates an Application Insights web test definition. +.Description +Creates or updates an Application Insights web test definition. +.Example +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` +-Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` +-RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'standard-pwsh01' ` +-RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation +.Example +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +-Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` +-GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` +-Kind 'ping' -RequestUrl 'https://cn.bing.com' -RequestParseDependent -RuleExpectedHttpStatusCode 200 ` +-ContentMatch "status" +.Example +$geoLocation = @() +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" +$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" +New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` +-Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` +-GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` +-Kind 'ping' ` +-Configuration " + + + + + + + + + + + + + +" + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest +.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. + +GEOLOCATION : A list of where to physically run the tests from to give global coverage for accessibility of your application. + [Location ]: Location ID for the WebTest to run from. + +REQUESTHEADER : List of headers and their values to add to the WebTest call. + [Name ]: The name of the header. + [Value ]: The value of the header. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightswebtest +#> +function New-AzApplicationInsightsWebTest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('WebTestName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights WebTest resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource location + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The XML specification of a WebTest to run against an application. + ${Configuration}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When set, this value makes the ContentMatch validation case insensitive. + ${ContentIgnoreCase}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Content to look for in the return of the WebTest. + # Must not be null or empty. + ${ContentMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When true, validation will pass if there is a match for the ContentMatch string. + # If false, validation will fail if there is a match + ${ContentPassIfTextFound}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # User defined description for this WebTest. + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Is the test actively being monitored. + ${Enabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Interval in seconds between test runs for this WebTest. + # Default value is 300. + ${Frequency}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation[]] + # A list of where to physically run the tests from to give global coverage for accessibility of your application. + # To construct, see NOTES section for GEOLOCATION properties and create a hash table. + ${GeoLocation}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum] + # The kind of web test this is, valid choices are ping, multistep, and standard. + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Base64 encoded string body to send with this web test. + ${RequestBody}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Follow redirects for this web test. + ${RequestFollowRedirect}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField[]] + # List of headers and their values to add to the WebTest call. + # To construct, see NOTES section for REQUESTHEADER properties and create a hash table. + ${RequestHeader}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Http verb to use for this web test. + ${RequestHttpVerb}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Parse Dependent request for this WebTest. + ${RequestParseDependent}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Url location to test. + ${RequestUrl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow for retries should this WebTest fail. + ${RetryEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Validate that the WebTest returns the http status code provided. + ${RuleExpectedHttpStatusCode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When set, validation will ignore the status code. + ${RuleIgnoreHttpsStatusCode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # A number of days to check still remain before the the existing SSL cert expires. + # Value must be positive and the SSLCheck must be set to true. + ${RuleSslCertRemainingLifetimeCheck}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Checks to see if the SSL cert is still valid. + ${RuleSslCheck}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # User defined name if this WebTest. + ${TestName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Seconds until this WebTest will timeout and fail. + # Default value is 30. + ${Timeout}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWebTest_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Description +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Example +PS C:\> New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights +#> +function New-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The kind of application that this component refers to, used to customize UI. + # This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. + ${Kind}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource location + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + # Type of application being monitored. + ${ApplicationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable IP masking. + ${DisableIPMasking}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable Non-AAD based Auth. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource etag + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + # Used by the Application Insights system to determine what kind of flow this component was created by. + # This is to be set to 'Bluefield' when creating/updating a component via the REST API. + ${FlowType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Force users to create their own storage account for profiler and debugger. + ${ForceCustomerStorageForProfiler}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + ${HockeyAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Purge data immediately after 30 days. + ${ImmediatePurgeDataOn30Day}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + # Indicates the flow of the ingestion. + ${IngestionMode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights ingestion. + ${PublicNetworkAccessForIngestion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights query. + ${PublicNetworkAccessForQuery}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + # Describes what tool created this Application Insights component. + # Customers using this API should set this to the default 'rest'. + ${RequestSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Retention period in days. + ${RetentionInDay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + ${SamplingPercentage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource Id of the log analytics workspace which the data will be ingested to. + # This property is required to create an application with this API version. + # Applications from older versions will not have this property. + ${WorkspaceResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Delete an Annotation of an Application Insights component. +.Description +Delete an Annotation of an Application Insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +System.Boolean +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightsannotation +#> +function Remove-AzApplicationInsightsAnnotation { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('AnnotationId')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The unique annotation ID. + # This is unique within a Application Insights component. + ${Id}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsAnnotation_Delete'; + DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsAnnotation_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Update current billing features for an Application Insights component. +.Description +Update current billing features for an Application Insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightscomponentcurrentbillingfeature +#> +function Set-AzApplicationInsightsComponentCurrentBillingFeature { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # Current enabled pricing plan. + # When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + ${CurrentBillingFeature}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Single] + # Daily data volume cap in GB. + ${DataVolumeCap}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Do not send a notification email when the daily data volume cap is met. + ${DataVolumeCapStopSendNotificationWhenHitCap}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Reserved, not used for now. + ${DataVolumeCapStopSendNotificationWhenHitThreshold}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Reserved, not used for now. + ${DataVolumeCapWarningThreshold}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Update the Continuous Export configuration for this export id. .Description -List the available operations supported by the Microsoft.EventGrid resource provider. +Update the Continuous Export configuration for this export id. +.Example +PS C:\> $sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +PS C:\> $sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +PS C:\> Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" +-DocumentType "Request","Trace" -ExportId "jlTFEiBg1rkDXOCIeJQ2mB2TxZg=" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus +-StorageSASUri $sasuri + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightscontinuousexport +#> +function Set-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The Continuous Export configuration ID. + # This is unique within a Application Insights component. + ${ExportId}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The subscription ID of the destination storage container. + ${DestinationStorageSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The Continuous Export destination type. + # This has to be 'Blob'. + ${DestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. + ${IsEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The document types to be exported, as comma separated values. + # Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + ${RecordType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of destination storage account. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The location ID of the destination storage container. + ${StorageLocation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The SAS URL for the destination storage container. + # It must grant write permission. + ${StorageSASUri}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsContinuousExport_UpdateExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Description +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Example -PS C:\> {{ Add code here }} +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsights +#> +function Set-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The kind of application that this component refers to, used to customize UI. + # This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. + ${Kind}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource location + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + # Type of application being monitored. + ${ApplicationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable IP masking. + ${DisableIPMasking}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable Non-AAD based Auth. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource etag + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + # Used by the Application Insights system to determine what kind of flow this component was created by. + # This is to be set to 'Bluefield' when creating/updating a component via the REST API. + ${FlowType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Force users to create their own storage account for profiler and debugger. + ${ForceCustomerStorageForProfiler}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + ${HockeyAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Purge data immediately after 30 days. + ${ImmediatePurgeDataOn30Day}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + # Indicates the flow of the ingestion. + ${IngestionMode}, -{{ Add output here }} -.Example -PS C:\> {{ Add code here }} + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights ingestion. + ${PublicNetworkAccessForIngestion}, -{{ Add output here }} + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights query. + ${PublicNetworkAccessForQuery}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + # Describes what tool created this Application Insights component. + # Customers using this API should set this to the default 'rest'. + ${RequestSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Retention period in days. + ${RetentionInDay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + ${SamplingPercentage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource Id of the log analytics workspace which the data will be ingested to. + # This property is required to create an application with this API version. + # Applications from older versions will not have this property. + ${WorkspaceResourceId}, -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IOperation -.Link -https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsoperation -#> -function Get-AzApplicationInsightsOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IOperation])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -65,12 +3327,6 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] [System.Uri] @@ -98,8 +3354,12 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ - List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsOperation_List'; + UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsights_UpdateExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -107,6 +3367,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + throw } } @@ -115,273 +3376,97 @@ process { try { $steppablePipeline.Process($_) } catch { + throw } -} +} end { try { $steppablePipeline.End() + } catch { + throw } -} +} } <# .Synopsis -Creates or updates an Application Insights web test definition. +Updates an existing component's tags. +To update other fields use the CreateOrUpdate method. .Description -Creates or updates an Application Insights web test definition. -.Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroup azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' ` --Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` --RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'standard-pwsh01' ` --RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -standard-pwsh01 westus2 standard azpwsh-rg-test True +Updates an existing component's tags. +To update other fields use the CreateOrUpdate method. .Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` --Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` --GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` --Kind 'ping' -RequestUrl 'https://cn.bing.com' -RequestParseDependent -RuleExpectedHttpStatusCode 200 ` --ContentMatch "status" - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True +{{ Add code here }} .Example -PS C:\> $geoLocation = @() -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" -PS C:\> $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr" -PS C:\> New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' ` --Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} ` --GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 ` --Kind 'ping' ` --Configuration " - - - - - - - - - - - - - -" - -Name Location WebTestKind ResourceGroupName Enabled ----- -------- ----------- ----------------- ------- -pingwebtest-pwsh01 westus2 ping azpwsh-rg-test True +{{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent .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. -GEOLOCATION : A list of where to physically run the tests from to give global coverage for accessibility of your application. - [Location ]: Location ID for the WebTest to run from. - -REQUESTHEADER : List of headers and their values to add to the WebTest call. - [Name ]: The name of the header. - [Value ]: The value of the header. +INPUTOBJECT : Identity Parameter + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. .Link -https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightswebtest +https://docs.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightscomponenttag #> -function New-AzApplicationInsightsWebTest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Update-AzApplicationInsightsComponentTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] - [Alias('WebTestName')] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] - # The name of the Application Insights WebTest resource. + # The name of the Application Insights component resource. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # Resource location - ${Location}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # The XML specification of a WebTest to run against an application. - ${Configuration}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # When set, this value makes the ContentMatch validation case insensitive. - ${ContentIgnoreCase}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # Content to look for in the return of the WebTest. - # Must not be null or empty. - ${ContentMatch}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # When true, validation will pass if there is a match for the ContentMatch string. - # If false, validation will fail if there is a match - ${ContentPassIfTextFound}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # User defined description for this WebTest. - ${Description}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Is the test actively being monitored. - ${Enabled}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Int32] - # Interval in seconds between test runs for this WebTest. - # Default value is 300. - ${Frequency}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation[]] - # A list of where to physically run the tests from to give global coverage for accessibility of your application. - # To construct, see NOTES section for GEOLOCATION properties and create a hash table. - ${GeoLocation}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum])] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum] - # The kind of web test this is, valid choices are ping, multistep, and standard. - ${Kind}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # Base64 encoded string body to send with this web test. - ${RequestBody}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Follow redirects for this web test. - ${RequestFollowRedirect}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField[]] - # List of headers and their values to add to the WebTest call. - # To construct, see NOTES section for REQUESTHEADER properties and create a hash table. - ${RequestHeader}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # Http verb to use for this web test. - ${RequestHttpVerb}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Parse Dependent request for this WebTest. - ${RequestParseDependent}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # Url location to test. - ${RequestUrl}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Allow for retries should this WebTest fail. - ${RetryEnabled}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Int32] - # Validate that the WebTest returns the http status code provided. - ${RuleExpectedHttpStatusCode}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # When set, validation will ignore the status code. - ${RuleIgnoreHttpsStatusCode}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Int32] - # A number of days to check still remain before the the existing SSL cert expires. - # Value must be positive and the SSLCheck must be set to true. - ${RuleSslCertRemainingLifetimeCheck}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Checks to see if the SSL cert is still valid. - ${RuleSslCheck}, + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebtestsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # User defined name if this WebTest. - ${TestName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.Int32] - # Seconds until this WebTest will timeout and fail. - # Default value is 30. - ${Timeout}, - [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -437,10 +3522,12 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ - CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWebTest_CreateExpanded'; + UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateViaIdentityExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -449,6 +3536,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + throw } } @@ -457,15 +3545,18 @@ process { try { $steppablePipeline.Process($_) } catch { + throw } -} +} end { try { $steppablePipeline.End() + } catch { + throw } -} +} } diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/README.md b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/README.md index 3b370367dd75..77829e2688c6 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/README.md +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/README.md @@ -1,5 +1,5 @@ # Internal -This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression). 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. +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#cmdlet-hiding-exportation-suppression). 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 @@ -11,4 +11,4 @@ This directory contains a module to handle *internal only* cmdlets. Cmdlets that The `Az.ApplicationInsights.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.ApplicationInsights`. Instead, this sub-module is imported by the `..\custom\Az.ApplicationInsights.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.ApplicationInsights.internal\Get-Example` would call an internal cmdlet named `Get-Example`. ## Purpose -This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.ApplicationInsights`. \ No newline at end of file +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.ApplicationInsights`. diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Remove-AzApplicationInsightsAnnotation.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Remove-AzApplicationInsightsAnnotation.ps1 new file mode 100644 index 000000000000..d87ea5c21777 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Remove-AzApplicationInsightsAnnotation.ps1 @@ -0,0 +1,188 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Delete an Annotation of an Application Insights component. +.Description +Delete an Annotation of an Application Insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +System.Boolean +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightsannotation +#> +function Remove-AzApplicationInsightsAnnotation { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('AnnotationId')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The unique annotation ID. + # This is unique within a Application Insights component. + ${Id}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsAnnotation_Delete'; + DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsAnnotation_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsights.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsights.ps1 new file mode 100644 index 000000000000..94b50879d52f --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsights.ps1 @@ -0,0 +1,270 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Description +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsights +#> +function Set-AzApplicationInsights { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The kind of application that this component refers to, used to customize UI. + # This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. + ${Kind}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource location + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + # Type of application being monitored. + ${ApplicationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable IP masking. + ${DisableIPMasking}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Disable Non-AAD based Auth. + ${DisableLocalAuth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource etag + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + # Used by the Application Insights system to determine what kind of flow this component was created by. + # This is to be set to 'Bluefield' when creating/updating a component via the REST API. + ${FlowType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Force users to create their own storage account for profiler and debugger. + ${ForceCustomerStorageForProfiler}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + ${HockeyAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Purge data immediately after 30 days. + ${ImmediatePurgeDataOn30Day}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + # Indicates the flow of the ingestion. + ${IngestionMode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights ingestion. + ${PublicNetworkAccessForIngestion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + # The network access type for accessing Application Insights query. + ${PublicNetworkAccessForQuery}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + # Describes what tool created this Application Insights component. + # Customers using this API should set this to the default 'rest'. + ${RequestSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Retention period in days. + ${RetentionInDay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Double] + # Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + ${SamplingPercentage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Resource Id of the log analytics workspace which the data will be ingested to. + # This property is required to create an application with this API version. + # Applications from older versions will not have this property. + ${WorkspaceResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsights_UpdateExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsComponentCurrentBillingFeature.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsComponentCurrentBillingFeature.ps1 new file mode 100644 index 000000000000..69013aac70dd --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsComponentCurrentBillingFeature.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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update current billing features for an Application Insights component. +.Description +Update current billing features for an Application Insights component. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightscomponentcurrentbillingfeature +#> +function Set-AzApplicationInsightsComponentCurrentBillingFeature { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # Current enabled pricing plan. + # When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + ${CurrentBillingFeature}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Single] + # Daily data volume cap in GB. + ${DataVolumeCap}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Do not send a notification email when the daily data volume cap is met. + ${DataVolumeCapStopSendNotificationWhenHitCap}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Reserved, not used for now. + ${DataVolumeCapStopSendNotificationWhenHitThreshold}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Int32] + # Reserved, not used for now. + ${DataVolumeCapWarningThreshold}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsContinuousExport.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsContinuousExport.ps1 new file mode 100644 index 000000000000..05d2c79e732b --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsContinuousExport.ps1 @@ -0,0 +1,214 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Update the Continuous Export configuration for this export id. +.Description +Update the Continuous Export configuration for this export id. +.Example +PS C:\> $sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +PS C:\> $sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +PS C:\> Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" +-DocumentType "Request","Trace" -ExportId "jlTFEiBg1rkDXOCIeJQ2mB2TxZg=" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus +-StorageSASUri $sasuri + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightscontinuousexport +#> +function Set-AzApplicationInsightsContinuousExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The Continuous Export configuration ID. + # This is unique within a Application Insights component. + ${ExportId}, + + [Parameter(Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The subscription ID of the destination storage container. + ${DestinationStorageSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The Continuous Export destination type. + # This has to be 'Blob'. + ${DestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'. + ${IsEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Deprecated + ${NotificationQueueUri}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The document types to be exported, as comma separated values. + # Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. + ${RecordType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The name of destination storage account. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The location ID of the destination storage container. + ${StorageLocation}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # The SAS URL for the destination storage container. + # It must grant write permission. + ${StorageSASUri}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsContinuousExport_UpdateExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Update-AzApplicationInsightsComponentTag.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Update-AzApplicationInsightsComponentTag.ps1 new file mode 100644 index 000000000000..505439fdc4b2 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/internal/Update-AzApplicationInsightsComponentTag.ps1 @@ -0,0 +1,184 @@ + +# ---------------------------------------------------------------------------------- +# 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 +Updates an existing component's tags. +To update other fields use the CreateOrUpdate method. +.Description +Updates an existing component's tags. +To update other fields use the CreateOrUpdate method. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +.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 + [AnnotationId ]: The unique annotation ID. This is unique within a Application Insights component. + [ComponentName ]: The name of the Application Insights component resource. + [ExportId ]: The Continuous Export configuration ID. This is unique within a Application Insights component. + [Id ]: Resource identity path + [KeyId ]: The API Key ID. This is unique within a Application Insights component. + [PurgeId ]: In a purge status request, this is the Id of the operation the status of which is returned. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the Application Insights component resource. + [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [SubscriptionId ]: The ID of the target subscription. + [WebTestName ]: The name of the Application Insights WebTest resource. +.Link +https://docs.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightscomponenttag +#> +function Update-AzApplicationInsightsComponentTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ApplicationInsightsComponentName', 'ComponentName')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the Application Insights component resource. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.ITagsResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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 + + $mapping = @{ + UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/ApplicationInsightsComponent.Recording.json b/src/ApplicationInsights/ApplicationInsights.Autorest/test/ApplicationInsightsComponent.Recording.json new file mode 100644 index 000000000000..b9e546276048 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/ApplicationInsightsComponent.Recording.json @@ -0,0 +1,167 @@ +{ + "ApplicationInsightsComponent+[NoContext]+Component+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/componentfu7emc?api-version=2020-02-02+1": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/componentfu7emc?api-version=2020-02-02", + "Content": "{\r\n \"location\": \"westus2\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\"\r\n },\r\n \"kind\": \"web\"\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "103" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "5a541b35-70a0-4a35-83a0-9c308a4fb421" ], + "X-Content-Type-Options": [ "nosniff" ], + "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], + "Access-Control-Expose-Headers": [ "Request-Context" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Server": [ "Microsoft-IIS/10.0" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-writes": [ "1196" ], + "x-ms-correlation-request-id": [ "7ee69ac9-37e6-4248-be3e-1ae45dd2e487" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034554Z:7ee69ac9-37e6-4248-be3e-1ae45dd2e487" ], + "Date": [ "Tue, 10 May 2022 03:45:54 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "1082" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/componentfu7emc\",\"name\":\"componentfu7emc\",\"type\":\"microsoft.insights/components\",\"location\":\"westus2\",\"tags\":{},\"kind\":\"web\",\"etag\":\"\\\"f600ef0d-0000-0600-0000-6279dff00000\\\"\",\"properties\":{\"Ver\":\"v2\",\"ApplicationId\":\"componentfu7emc\",\"AppId\":\"f41169cf-c2bd-4881-93e3-1965f9c4f6fe\",\"Application_Type\":\"web\",\"Flow_Type\":null,\"Request_Source\":null,\"InstrumentationKey\":\"cd8db8d9-7e94-4e94-b233-b9caa92ba02a\",\"ConnectionString\":\"InstrumentationKey=cd8db8d9-7e94-4e94-b233-b9caa92ba02a;IngestionEndpoint=https://westus2-1.in.applicationinsights.azure.com/;LiveEndpoint=https://westus2.livediagnostics.monitor.azure.com/\",\"Name\":\"componentfu7emc\",\"CreationDate\":\"2022-05-10T03:45:52.4014101+00:00\",\"TenantId\":\"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\"provisioningState\":\"Succeeded\",\"SamplingPercentage\":null,\"RetentionInDays\":90,\"IngestionMode\":\"ApplicationInsights\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Enabled\"}}", + "isContentBase64": false + } + }, + "ApplicationInsightsComponent+[NoContext]+Component+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/componentfu7emc?api-version=2020-02-02+2": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/componentfu7emc?api-version=2020-02-02", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "6" ], + "x-ms-client-request-id": [ "25041e79-4d37-4d0e-ad27-8ab7e5f29b24" ], + "CommandName": [ "." ], + "FullCommandName": [ "Get-AzApplicationInsights_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "25041e79-4d37-4d0e-ad27-8ab7e5f29b24" ], + "X-Content-Type-Options": [ "nosniff" ], + "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], + "Access-Control-Expose-Headers": [ "Request-Context" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Server": [ "Microsoft-IIS/10.0" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11999" ], + "x-ms-correlation-request-id": [ "1a8fa56a-147e-4272-94c9-033745ca704e" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034556Z:1a8fa56a-147e-4272-94c9-033745ca704e" ], + "Date": [ "Tue, 10 May 2022 03:45:56 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "1082" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/componentfu7emc\",\"name\":\"componentfu7emc\",\"type\":\"microsoft.insights/components\",\"location\":\"westus2\",\"tags\":{},\"kind\":\"web\",\"etag\":\"\\\"f600ef0d-0000-0600-0000-6279dff00000\\\"\",\"properties\":{\"Ver\":\"v2\",\"ApplicationId\":\"componentfu7emc\",\"AppId\":\"f41169cf-c2bd-4881-93e3-1965f9c4f6fe\",\"Application_Type\":\"web\",\"Flow_Type\":null,\"Request_Source\":null,\"InstrumentationKey\":\"cd8db8d9-7e94-4e94-b233-b9caa92ba02a\",\"ConnectionString\":\"InstrumentationKey=cd8db8d9-7e94-4e94-b233-b9caa92ba02a;IngestionEndpoint=https://westus2-1.in.applicationinsights.azure.com/;LiveEndpoint=https://westus2.livediagnostics.monitor.azure.com/\",\"Name\":\"componentfu7emc\",\"CreationDate\":\"2022-05-10T03:45:52.4014101+00:00\",\"TenantId\":\"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\"provisioningState\":\"Succeeded\",\"SamplingPercentage\":null,\"RetentionInDays\":90,\"IngestionMode\":\"ApplicationInsights\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Enabled\"}}", + "isContentBase64": false + } + }, + "ApplicationInsightsComponent+[NoContext]+Component+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/componentfu7emc?api-version=2020-02-02+3": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/componentfu7emc?api-version=2020-02-02", + "Content": "{\r\n \"location\": \"westus2\",\r\n \"tags\": {\r\n \"key\": \"val\"\r\n },\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"RetentionInDays\": 90,\r\n \"publicNetworkAccessForIngestion\": \"Disabled\",\r\n \"publicNetworkAccessForQuery\": \"Disabled\",\r\n \"IngestionMode\": \"ApplicationInsights\"\r\n },\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"f600ef0d-0000-0600-0000-6279dff00000\\\"\"\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "368" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "ebd47db3-e0a5-4a2c-8076-a7655ba240fc" ], + "X-Content-Type-Options": [ "nosniff" ], + "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], + "Access-Control-Expose-Headers": [ "Request-Context" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Server": [ "Microsoft-IIS/10.0" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-writes": [ "1195" ], + "x-ms-correlation-request-id": [ "036754f0-fdf5-4158-8cc8-ecd32e867613" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034622Z:036754f0-fdf5-4158-8cc8-ecd32e867613" ], + "Date": [ "Tue, 10 May 2022 03:46:21 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "1114" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/componentfu7emc\",\"name\":\"componentfu7emc\",\"type\":\"microsoft.insights/components\",\"location\":\"westus2\",\"tags\":{\"key\":\"val\"},\"kind\":\"web\",\"etag\":\"\\\"f600770e-0000-0600-0000-6279dff80000\\\"\",\"properties\":{\"Ver\":\"v2\",\"ApplicationId\":\"componentfu7emc\",\"AppId\":\"f41169cf-c2bd-4881-93e3-1965f9c4f6fe\",\"Application_Type\":\"web\",\"Flow_Type\":null,\"Request_Source\":null,\"InstrumentationKey\":\"cd8db8d9-7e94-4e94-b233-b9caa92ba02a\",\"ConnectionString\":\"InstrumentationKey=cd8db8d9-7e94-4e94-b233-b9caa92ba02a;IngestionEndpoint=https://westus2-1.in.applicationinsights.azure.com/;LiveEndpoint=https://westus2.livediagnostics.monitor.azure.com/\",\"Name\":\"componentfu7emc\",\"CreationDate\":\"2022-05-10T03:45:52.4014101+00:00\",\"TenantId\":\"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\"provisioningState\":\"Succeeded\",\"SamplingPercentage\":null,\"RetentionInDays\":90,\"Retention\":\"P90D\",\"IngestionMode\":\"ApplicationInsights\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Disabled\"}}", + "isContentBase64": false + } + }, + "ApplicationInsightsComponent+[NoContext]+Component+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/componentfu7emc?api-version=2020-02-02+4": { + "Request": { + "Method": "DELETE", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/componentfu7emc?api-version=2020-02-02", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "9" ], + "x-ms-client-request-id": [ "b4c7457e-9aa7-4efb-8cea-3245d2cd0a39" ], + "CommandName": [ "Remove-AzApplicationInsights" ], + "FullCommandName": [ "Remove-AzApplicationInsights_Delete" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "b4c7457e-9aa7-4efb-8cea-3245d2cd0a39" ], + "X-Content-Type-Options": [ "nosniff" ], + "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], + "Access-Control-Expose-Headers": [ "Request-Context" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Server": [ "Microsoft-IIS/10.0" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-deletes": [ "14999" ], + "x-ms-correlation-request-id": [ "243893c3-611d-46aa-95a7-d76a99da04a8" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034630Z:243893c3-611d-46aa-95a7-d76a99da04a8" ], + "Date": [ "Tue, 10 May 2022 03:46:30 GMT" ] + }, + "ContentHeaders": { + "Expires": [ "-1" ], + "Content-Length": [ "0" ] + }, + "Content": null, + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/ApplicationInsightsComponent.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/ApplicationInsightsComponent.Tests.ps1 new file mode 100644 index 000000000000..52f8281577a4 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/ApplicationInsightsComponent.Tests.ps1 @@ -0,0 +1,41 @@ +if(($null -eq $TestName) -or ($TestName -contains 'ApplicationInsightsComponent')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'ApplicationInsightsComponent.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'ApplicationInsightsComponent' { + It 'Component' { + $kind = "web"; + $key = "key" + $val = "val" + $tag = @{$key=$val} + + New-AzApplicationInsights -ResourceGroupName $env.resourceGroup -Name $env.component1 -Location $env.location -Kind $kind + $component = Get-AzApplicationInsights -ResourceGroupName $env.resourceGroup -Name $env.component1 + + $component.Name | Should -Be $env.component1 + $component.Kind | Should -Be $kind + $component.InstrumentationKey | Should -Not -BeNullOrEmpty + "Enabled" | Should -Be $component.PublicNetworkAccessForIngestion + "Enabled" | Should -Be $component.PublicNetworkAccessForQuery + + $component = Update-AzApplicationInsights -ResourceGroupName $env.resourceGroup -Name $env.component1 -Tag $tag -PublicNetworkAccessForIngestion "Disabled" -PublicNetworkAccessForQuery "Disabled" + + "Disabled" | Should -Be $component.PublicNetworkAccessForIngestion + "Disabled" | Should -Be $component.PublicNetworkAccessForQuery + $val | Should -Be $component.Tag[$key] + + Remove-AzApplicationInsights -ResourceGroupName $env.resourceGroup -Name $env.component1 + } +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsights.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsights.Tests.ps1 new file mode 100644 index 000000000000..369513a5821e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsights.Tests.ps1 @@ -0,0 +1,41 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzApplicationInsights')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzApplicationInsights.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzApplicationInsights' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ListByResourceGroupName' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ListBySubscription' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetByResourceId' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetByInputObject' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsApiKey.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsApiKey.Tests.ps1 new file mode 100644 index 000000000000..ecefd8da3542 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsApiKey.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzApplicationInsightsApiKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzApplicationInsightsApiKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzApplicationInsightsApiKey' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsContinuousExport.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsContinuousExport.Tests.ps1 new file mode 100644 index 000000000000..f159be3d3efd --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsContinuousExport.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzApplicationInsightsContinuousExport')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzApplicationInsightsContinuousExport.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzApplicationInsightsContinuousExport' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..01e65699ad4c --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzApplicationInsightsLinkedStorageAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzApplicationInsightsLinkedStorageAccount.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzApplicationInsightsLinkedStorageAccount' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsWebTest.Recording.json b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsWebTest.Recording.json index 189a78f02dc4..c16510d91912 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsWebTest.Recording.json +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Get-AzApplicationInsightsWebTest.Recording.json @@ -6,12 +6,12 @@ "Content": null, "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "1" ], - "x-ms-client-request-id": [ "97351404-ffa8-4c2b-8505-98909da787ad" ], + "x-ms-unique-id": [ "10" ], + "x-ms-client-request-id": [ "a815fafd-ccf4-4678-b20b-5d9cdbe7b134" ], "CommandName": [ "Get-AzApplicationInsightsWebTest" ], "FullCommandName": [ "Get-AzApplicationInsightsWebTest_List1" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -22,37 +22,37 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-original-request-ids": [ "97351404-ffa8-4c2b-8505-98909da787ad", "97351404-ffa8-4c2b-8505-98909da787ad" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11977" ], - "x-ms-request-id": [ "4f4d49ef-8109-4875-aefb-67453b783baa" ], - "x-ms-correlation-request-id": [ "4f4d49ef-8109-4875-aefb-67453b783baa" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084316Z:4f4d49ef-8109-4875-aefb-67453b783baa" ], + "x-ms-original-request-ids": [ "a815fafd-ccf4-4678-b20b-5d9cdbe7b134", "a815fafd-ccf4-4678-b20b-5d9cdbe7b134" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11997" ], + "x-ms-request-id": [ "19e90f97-de1a-4a82-aa61-2fddab2932a7" ], + "x-ms-correlation-request-id": [ "19e90f97-de1a-4a82-aa61-2fddab2932a7" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034634Z:19e90f97-de1a-4a82-aa61-2fddab2932a7" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": [ "nosniff" ], - "Date": [ "Wed, 10 Nov 2021 08:43:16 GMT" ] + "Date": [ "Tue, 10 May 2022 03:46:33 GMT" ] }, "ContentHeaders": { "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ], - "Content-Length": [ "17322" ] + "Content-Length": [ "1157" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/webtests/pingwebtest-01-appinsights-portal01\",\"name\":\"pingwebtest-01-appinsights-portal01\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/components/appinsights-portal01\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"00008e31-0000-0600-0000-6188c4a50000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"pingwebtest-01-appinsights-portal01\",\"Name\":\"pingwebtest-01\",\"Description\":\"\",\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"ping\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"us-ca-sjc-azr\"},{\"Id\":\"apac-sg-sin-azr\"},{\"Id\":\"us-il-ch1-azr\"},{\"Id\":\"emea-ch-zrh-edge\"},{\"Id\":\"latam-br-gru-edge\"}],\"Configuration\":{\"WebTest\":\"\u003cWebTest Name=\\\"pingwebtest-01\\\" Id=\\\"b7df66e3-931f-4651-9040-58f2329a74bd\\\" Enabled=\\\"True\\\" CssProjectStructure=\\\"\\\" CssIteration=\\\"\\\" Timeout=\\\"120\\\" WorkItemIds=\\\"\\\" xmlns=\\\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\\\" Description=\\\"\\\" CredentialUserName=\\\"\\\" CredentialPassword=\\\"\\\" PreAuthenticate=\\\"True\\\" Proxy=\\\"default\\\" StopOnError=\\\"False\\\" RecordedResultFile=\\\"\\\" ResultsLocale=\\\"\\\"\u003e \u003cItems\u003e \u003cRequest Method=\\\"GET\\\" Guid=\\\"adce4cc5-9d88-a536-1dec-d98cfde8f16a\\\" Version=\\\"1.1\\\" Url=\\\"https://google.com\\\" ThinkTime=\\\"0\\\" Timeout=\\\"120\\\" ParseDependentRequests=\\\"False\\\" FollowRedirects=\\\"True\\\" RecordResult=\\\"True\\\" Cache=\\\"False\\\" ResponseTimeGoal=\\\"0\\\" Encoding=\\\"utf-8\\\" ExpectedHttpStatusCode=\\\"200\\\" ExpectedResponseUrl=\\\"\\\" ReportingName=\\\"\\\" IgnoreHttpStatusCode=\\\"False\\\" /\u003e \u003c/Items\u003e \u003c/WebTest\u003e\"},\"Request\":null,\"ValidationRules\":null,\"provisioningState\":\"Succeeded\"}},{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/webtests/pingwebtest-02-appinsights-portal01\",\"name\":\"pingwebtest-02-appinsights-portal01\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/components/appinsights-portal01\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"00009631-0000-0600-0000-6188c5150000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"pingwebtest-02-appinsights-portal01\",\"Name\":\"pingwebtest-02\",\"Description\":\"\",\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"ping\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"us-tx-sn1-azr\"},{\"Id\":\"emea-ch-zrh-edge\"},{\"Id\":\"apac-hk-hkn-azr\"},{\"Id\":\"us-fl-mia-edge\"},{\"Id\":\"latam-br-gru-edge\"}],\"Configuration\":{\"WebTest\":\"\u003cWebTest Name=\\\"pingwebtest-02\\\" Id=\\\"97e6fc4f-05f2-4ada-bb78-0a440c5f26e3\\\" Enabled=\\\"True\\\" CssProjectStructure=\\\"\\\" CssIteration=\\\"\\\" Timeout=\\\"120\\\" WorkItemIds=\\\"\\\" xmlns=\\\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\\\" Description=\\\"\\\" CredentialUserName=\\\"\\\" CredentialPassword=\\\"\\\" PreAuthenticate=\\\"True\\\" Proxy=\\\"default\\\" StopOnError=\\\"False\\\" RecordedResultFile=\\\"\\\" ResultsLocale=\\\"\\\"\u003e \u003cItems\u003e \u003cRequest Method=\\\"GET\\\" Guid=\\\"a32bd645-4e33-7278-cee8-bc467c941777\\\" Version=\\\"1.1\\\" Url=\\\"https://google.com\\\" ThinkTime=\\\"0\\\" Timeout=\\\"120\\\" ParseDependentRequests=\\\"False\\\" FollowRedirects=\\\"True\\\" RecordResult=\\\"True\\\" Cache=\\\"False\\\" ResponseTimeGoal=\\\"0\\\" Encoding=\\\"utf-8\\\" ExpectedHttpStatusCode=\\\"200\\\" ExpectedResponseUrl=\\\"\\\" ReportingName=\\\"\\\" IgnoreHttpStatusCode=\\\"False\\\" /\u003e \u003c/Items\u003e \u003c/WebTest\u003e\"},\"Request\":null,\"ValidationRules\":null,\"provisioningState\":\"Succeeded\"}},{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/webtests/pingwentest-03-appinsights-portal01\",\"name\":\"pingwentest-03-appinsights-portal01\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/components/appinsights-portal01\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"00006866-0000-0600-0000-618a168e0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"pingwentest-03-appinsights-portal01\",\"Name\":\"pingwentest-03\",\"Description\":\"\",\"Enabled\":true,\"Frequency\":600,\"Timeout\":120,\"Kind\":\"ping\",\"RetryEnabled\":false,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"},{\"Id\":\"apac-sg-sin-azr\"},{\"Id\":\"us-tx-sn1-azr\"},{\"Id\":\"latam-br-gru-edge\"}],\"Configuration\":{\"WebTest\":\"\u003cWebTest Name=\\\"pingwentest-03\\\" Id=\\\"6fd919c8-cc65-4fe1-9b86-6bbc344db0cf\\\" Enabled=\\\"True\\\" CssProjectStructure=\\\"\\\" CssIteration=\\\"\\\" Timeout=\\\"120\\\" WorkItemIds=\\\"\\\" xmlns=\\\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\\\" Description=\\\"\\\" CredentialUserName=\\\"\\\" CredentialPassword=\\\"\\\" PreAuthenticate=\\\"True\\\" Proxy=\\\"default\\\" StopOnError=\\\"False\\\" RecordedResultFile=\\\"\\\" ResultsLocale=\\\"\\\"\u003e \u003cItems\u003e \u003cRequest Method=\\\"GET\\\" Guid=\\\"a23e79cb-a52d-2d1f-1cd2-427ea47148ab\\\" Version=\\\"1.1\\\" Url=\\\"https://www.bing.com\\\" ThinkTime=\\\"0\\\" Timeout=\\\"120\\\" ParseDependentRequests=\\\"True\\\" FollowRedirects=\\\"True\\\" RecordResult=\\\"True\\\" Cache=\\\"False\\\" ResponseTimeGoal=\\\"0\\\" Encoding=\\\"utf-8\\\" ExpectedHttpStatusCode=\\\"200\\\" ExpectedResponseUrl=\\\"\\\" ReportingName=\\\"\\\" IgnoreHttpStatusCode=\\\"False\\\" /\u003e \u003c/Items\u003e \u003c/WebTest\u003e\"},\"Request\":null,\"ValidationRules\":null,\"provisioningState\":\"Succeeded\"}},{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/webtests/pingwebtest-04-appinsights-portal01\",\"name\":\"pingwebtest-04-appinsights-portal01\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/components/appinsights-portal01\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000bc66-0000-0600-0000-618a19b70000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"pingwebtest-04-appinsights-portal01\",\"Name\":\"pingwebtest-04\",\"Description\":\"\",\"Enabled\":true,\"Frequency\":300,\"Timeout\":90,\"Kind\":\"ping\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"us-tx-sn1-azr\"},{\"Id\":\"us-il-ch1-azr\"},{\"Id\":\"emea-gb-db3-azr\"},{\"Id\":\"apac-jp-kaw-edge\"},{\"Id\":\"latam-br-gru-edge\"}],\"Configuration\":{\"WebTest\":\"\u003cWebTest Name=\\\"pingwebtest-04\\\" Id=\\\"b12f0219-1c00-4c96-b830-9543fcdb187f\\\" Enabled=\\\"True\\\" CssProjectStructure=\\\"\\\" CssIteration=\\\"\\\" Timeout=\\\"90\\\" WorkItemIds=\\\"\\\" xmlns=\\\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\\\" Description=\\\"\\\" CredentialUserName=\\\"\\\" CredentialPassword=\\\"\\\" PreAuthenticate=\\\"True\\\" Proxy=\\\"default\\\" StopOnError=\\\"False\\\" RecordedResultFile=\\\"\\\" ResultsLocale=\\\"\\\"\u003e \u003cItems\u003e \u003cRequest Method=\\\"GET\\\" Guid=\\\"a2a5d61b-bac0-f48d-a650-bad59e505d74\\\" Version=\\\"1.1\\\" Url=\\\"https://google.com\\\" ThinkTime=\\\"0\\\" Timeout=\\\"90\\\" ParseDependentRequests=\\\"True\\\" FollowRedirects=\\\"True\\\" RecordResult=\\\"True\\\" Cache=\\\"False\\\" ResponseTimeGoal=\\\"0\\\" Encoding=\\\"utf-8\\\" ExpectedHttpStatusCode=\\\"300\\\" ExpectedResponseUrl=\\\"\\\" ReportingName=\\\"\\\" IgnoreHttpStatusCode=\\\"False\\\" /\u003e \u003c/Items\u003e \u003cValidationRules\u003e \u003cValidationRule Classname=\\\"Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidationRuleFindText, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\\\" DisplayName=\\\"Find Text\\\" Description=\\\"Verifies the existence of the specified text in the response.\\\" Level=\\\"High\\\" ExectuionOrder=\\\"BeforeDependents\\\"\u003e \u003cRuleParameters\u003e \u003cRuleParameter Name=\\\"FindText\\\" Value=\\\"\\\" /\u003e \u003cRuleParameter Name=\\\"IgnoreCase\\\" Value=\\\"False\\\" /\u003e \u003cRuleParameter Name=\\\"UseRegularExpression\\\" Value=\\\"False\\\" /\u003e \u003cRuleParameter Name=\\\"PassIfTextFound\\\" Value=\\\"True\\\" /\u003e \u003c/RuleParameters\u003e \u003c/ValidationRule\u003e \u003c/ValidationRules\u003e \u003c/WebTest\u003e\"},\"Request\":null,\"ValidationRules\":null,\"provisioningState\":\"Succeeded\"}},{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/webtests/pingwebtest-pwsh01\",\"name\":\"pingwebtest-pwsh01\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/components/appinsights-portal01\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"00002169-0000-0600-0000-618a29d50000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"pingwebtest-pwsh01\",\"Name\":\"pingwentest-pwsh01testname\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":90,\"Kind\":\"ping\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"},{\"Id\":\"emea-ru-msa-edge\"},{\"Id\":\"emea-se-sto-edge\"}],\"Configuration\":{\"WebTest\":\"\u003cWebTest Name=\\\"basic-portal03\\\" Id=\\\"9407db10-5d84-487f-98a3-a1ee67bb98f0\\\" Enabled=\\\"True\\\" CssProjectStructure=\\\"\\\" CssIteration=\\\"\\\" Timeout=\\\"90\\\" WorkItemIds=\\\"\\\" xmlns=\\\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\\\" Description=\\\"\\\" CredentialUserName=\\\"\\\" CredentialPassword=\\\"\\\" PreAuthenticate=\\\"True\\\" Proxy=\\\"default\\\" StopOnError=\\\"False\\\" RecordedResultFile=\\\"\\\" ResultsLocale=\\\"\\\"\u003e \\n \u003cItems\u003e \\n \u003cRequest Method=\\\"GET\\\" Guid=\\\"a2025e53-0702-d03e-f311-5774ec16893d\\\" Version=\\\"1.1\\\" Url=\\\"https://www.bing.com\\\" ThinkTime=\\\"0\\\" Timeout=\\\"90\\\" ParseDependentRequests=\\\"True\\\" FollowRedirects=\\\"True\\\" RecordResult=\\\"True\\\" Cache=\\\"False\\\" ResponseTimeGoal=\\\"0\\\" Encoding=\\\"utf-8\\\" ExpectedHttpStatusCode=\\\"200\\\" ExpectedResponseUrl=\\\"\\\" ReportingName=\\\"\\\" IgnoreHttpStatusCode=\\\"False\\\" /\u003e \\n \u003c/Items\u003e \\n \u003cValidationRules\u003e \\n \u003cValidationRule Classname=\\\"Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidationRuleFindText, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\\\" DisplayName=\\\"Find Text\\\" Description=\\\"Verifies the existence of the specified text in the response.\\\" Level=\\\"High\\\" ExectuionOrder=\\\"BeforeDependents\\\"\u003e\\n \u003cRuleParameters\u003e \\n \u003cRuleParameter Name=\\\"FindText\\\" Value=\\\"test\u0026#x20;content\u0026#x20;match\\\" /\u003e \\n \u003cRuleParameter Name=\\\"IgnoreCase\\\" Value=\\\"False\\\" /\u003e \\n \u003cRuleParameter Name=\\\"UseRegularExpression\\\" Value=\\\"False\\\" /\u003e \\n \u003cRuleParameter Name=\\\"PassIfTextFound\\\" Value=\\\"True\\\" /\u003e \\n \u003c/RuleParameters\u003e \\n \u003c/ValidationRule\u003e \\n \u003c/ValidationRules\u003e \\n\u003c/WebTest\u003e\"},\"Request\":null,\"ValidationRules\":null,\"provisioningState\":\"Succeeded\"}},{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/webtests/standard-pwsh01\",\"name\":\"standard-pwsh01\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-rg-test/providers/microsoft.insights/components/appinsights-portal01\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000c198-0000-0600-0000-618b6b350000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standard-pwsh01\",\"Name\":\"standard-pwsh01\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"},{\"Id\":\"emea-ru-msa-edge\"},{\"Id\":\"emea-se-sto-edge\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://www.bing.com\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}},{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-ukn3r4-test/providers/microsoft.insights/webtests/standardwebtest-urfzk4-pwsh\",\"name\":\"standardwebtest-urfzk4-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-ukn3r4-test/providers/microsoft.insights/components/appInsights-egnha6-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"00006a9b-0000-0600-0000-618b79160000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-urfzk4-pwsh\",\"Name\":\"standardwebtest-urfzk4-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}},{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-9tk4sr-test/providers/microsoft.insights/webtests/standardwebtest-hxa0fj-pwsh\",\"name\":\"standardwebtest-hxa0fj-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-9tk4sr-test/providers/microsoft.insights/components/appInsights-j9u3bt-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000cb9c-0000-0600-0000-618b7f500000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-hxa0fj-pwsh\",\"Name\":\"standardwebtest-hxa0fj-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}},{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-6y08w1-test/providers/microsoft.insights/webtests/standardwebtest-81qzh7-pwsh\",\"name\":\"standardwebtest-81qzh7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-6y08w1-test/providers/microsoft.insights/components/appInsights-41bxrq-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000619d-0000-0600-0000-618b81de0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-81qzh7-pwsh\",\"Name\":\"standardwebtest-81qzh7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}},{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh\",\"name\":\"standardwebtest-f62wc7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000bf9d-0000-0600-0000-618b844d0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-f62wc7-pwsh\",\"Name\":\"standardwebtest-f62wc7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh\",\"name\":\"standardwebtest-p7kj09-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f600a20d-0000-0600-0000-6279dfe90000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-p7kj09-pwsh\",\"Name\":\"standardwebtest-p7kj09-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}]}", "isContentBase64": false } }, - "Get-AzApplicationInsightsWebTest+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview+1": { + "Get-AzApplicationInsightsWebTest+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "2" ], - "x-ms-client-request-id": [ "5b990b0d-4eb0-4454-b332-d6748c3450fd" ], + "x-ms-unique-id": [ "11" ], + "x-ms-client-request-id": [ "e2b55500-c012-4bab-aedf-0c517066ef4f" ], "CommandName": [ "Get-AzApplicationInsightsWebTest" ], "FullCommandName": [ "Get-AzApplicationInsightsWebTest_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -63,40 +63,40 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-request-id": [ "5b990b0d-4eb0-4454-b332-d6748c3450fd" ], + "x-ms-request-id": [ "e2b55500-c012-4bab-aedf-0c517066ef4f" ], "X-Content-Type-Options": [ "nosniff" ], "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], "Access-Control-Expose-Headers": [ "Request-Context" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "Server": [ "Microsoft-IIS/10.0" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11976" ], - "x-ms-correlation-request-id": [ "38f84c4a-0157-463f-ab66-99c2887150a5" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084318Z:38f84c4a-0157-463f-ab66-99c2887150a5" ], - "Date": [ "Wed, 10 Nov 2021 08:43:18 GMT" ] + "x-ms-ratelimit-remaining-subscription-reads": [ "11996" ], + "x-ms-correlation-request-id": [ "c8423532-d7e9-4641-a550-08660945f690" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034635Z:c8423532-d7e9-4641-a550-08660945f690" ], + "Date": [ "Tue, 10 May 2022 03:46:34 GMT" ] }, "ContentHeaders": { "Content-Length": [ "1145" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh\",\"name\":\"standardwebtest-f62wc7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000bf9d-0000-0600-0000-618b844d0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-f62wc7-pwsh\",\"Name\":\"standardwebtest-f62wc7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh\",\"name\":\"standardwebtest-p7kj09-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f600a20d-0000-0600-0000-6279dfe90000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-p7kj09-pwsh\",\"Name\":\"standardwebtest-p7kj09-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", "isContentBase64": false } }, - "Get-AzApplicationInsightsWebTest+[NoContext]+List2+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview+1": { + "Get-AzApplicationInsightsWebTest+[NoContext]+List2+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "3" ], - "x-ms-client-request-id": [ "dc064a8a-54ba-4ccd-8f70-6b747f9a5e60" ], + "x-ms-unique-id": [ "12" ], + "x-ms-client-request-id": [ "cf66faf1-10d4-42df-aa7a-0add3c899678" ], "CommandName": [ "Get-AzApplicationInsightsWebTest" ], "FullCommandName": [ "Get-AzApplicationInsightsWebTest_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -107,37 +107,37 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-original-request-ids": [ "dc064a8a-54ba-4ccd-8f70-6b747f9a5e60", "dc064a8a-54ba-4ccd-8f70-6b747f9a5e60" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11975" ], - "x-ms-request-id": [ "270b9588-f156-42b3-aa1f-8ca1ad1d76d3" ], - "x-ms-correlation-request-id": [ "270b9588-f156-42b3-aa1f-8ca1ad1d76d3" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084319Z:270b9588-f156-42b3-aa1f-8ca1ad1d76d3" ], + "x-ms-original-request-ids": [ "cf66faf1-10d4-42df-aa7a-0add3c899678", "cf66faf1-10d4-42df-aa7a-0add3c899678" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11995" ], + "x-ms-request-id": [ "dd0d5c48-c72b-422f-826b-991b2c5e6767" ], + "x-ms-correlation-request-id": [ "dd0d5c48-c72b-422f-826b-991b2c5e6767" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034636Z:dd0d5c48-c72b-422f-826b-991b2c5e6767" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": [ "nosniff" ], - "Date": [ "Wed, 10 Nov 2021 08:43:19 GMT" ] + "Date": [ "Tue, 10 May 2022 03:46:36 GMT" ] }, "ContentHeaders": { "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ], "Content-Length": [ "1157" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh\",\"name\":\"standardwebtest-f62wc7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000bf9d-0000-0600-0000-618b844d0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-f62wc7-pwsh\",\"Name\":\"standardwebtest-f62wc7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh\",\"name\":\"standardwebtest-p7kj09-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f600a20d-0000-0600-0000-6279dfe90000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-p7kj09-pwsh\",\"Name\":\"standardwebtest-p7kj09-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}]}", "isContentBase64": false } }, - "Get-AzApplicationInsightsWebTest+[NoContext]+List+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh/webtests?api-version=2018-05-01-preview+1": { + "Get-AzApplicationInsightsWebTest+[NoContext]+List+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh/webtests?api-version=2018-05-01-preview+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh/webtests?api-version=2018-05-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh/webtests?api-version=2018-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "4" ], - "x-ms-client-request-id": [ "7315df82-9d78-4b6b-b733-8eedd2b398fb" ], + "x-ms-unique-id": [ "13" ], + "x-ms-client-request-id": [ "b2d951c0-4681-4c25-88b1-7aacc0f1d1ab" ], "CommandName": [ "Get-AzApplicationInsightsWebTest" ], "FullCommandName": [ "Get-AzApplicationInsightsWebTest_List2" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -148,40 +148,40 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-request-id": [ "7315df82-9d78-4b6b-b733-8eedd2b398fb" ], - "X-Content-Type-Options": [ "nosniff" ], - "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], + "Request-Context": [ "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" ], "Access-Control-Expose-Headers": [ "Request-Context" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], "Server": [ "Microsoft-IIS/10.0" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11974" ], - "x-ms-correlation-request-id": [ "5bac9876-6b0d-43bd-98f2-4dd0cc078a90" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084321Z:5bac9876-6b0d-43bd-98f2-4dd0cc078a90" ], - "Date": [ "Wed, 10 Nov 2021 08:43:20 GMT" ] + "x-ms-ratelimit-remaining-subscription-reads": [ "11994" ], + "x-ms-request-id": [ "38175070-cd84-4e30-a7f9-f9b6a3173f60" ], + "x-ms-correlation-request-id": [ "38175070-cd84-4e30-a7f9-f9b6a3173f60" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034638Z:38175070-cd84-4e30-a7f9-f9b6a3173f60" ], + "Date": [ "Tue, 10 May 2022 03:46:37 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1173" ], + "Content-Length": [ "1694" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh\",\"name\":\"standardwebtest-f62wc7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000bf9d-0000-0600-0000-618b844d0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-f62wc7-pwsh\",\"Name\":\"standardwebtest-f62wc7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}],\"nextLink\":null}", + "Content": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh\",\r\n \"name\": \"standardwebtest-p7kj09-pwsh\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n \"location\": \"westus2\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\": \"Resource\"\r\n },\r\n \"kind\": null,\r\n \"etag\": \"\\\"f600a20d-0000-0600-0000-6279dfe90000\\\"\",\r\n \"properties\": {\r\n \"SyntheticMonitorId\": \"standardwebtest-p7kj09-pwsh\",\r\n \"Name\": \"standardwebtest-p7kj09-pwsh\",\r\n \"Description\": null,\r\n \"Enabled\": true,\r\n \"Frequency\": 300,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": \"emea-nl-ams-azr\"\r\n },\r\n {\r\n \"Id\": \"us-ca-sjc-azr\"\r\n }\r\n ],\r\n \"Configuration\": null,\r\n \"Request\": {\r\n \"RequestUrl\": \"https://docs.microsoft.com/\",\r\n \"Headers\": null,\r\n \"HttpVerb\": \"GET\",\r\n \"RequestBody\": null,\r\n \"ParseDependentRequests\": null,\r\n \"FollowRedirects\": null\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": 200,\r\n \"IgnoreHttpStatusCode\": null,\r\n \"ContentValidation\": null,\r\n \"SSLCheck\": null,\r\n \"SSLCertRemainingLifetimeCheck\": null\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ],\r\n \"nextLink\": null\r\n}", "isContentBase64": false } }, - "Get-AzApplicationInsightsWebTest+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview+1": { + "Get-AzApplicationInsightsWebTest+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "5" ], - "x-ms-client-request-id": [ "88e927fd-7d49-4494-b6ff-a44d1cebec3e" ], + "x-ms-unique-id": [ "14" ], + "x-ms-client-request-id": [ "5a4c2953-12a5-4e2a-b79c-d657fbad034d" ], "CommandName": [ "Get-AzApplicationInsightsWebTest" ], "FullCommandName": [ "Get-AzApplicationInsightsWebTest_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -192,40 +192,40 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-request-id": [ "88e927fd-7d49-4494-b6ff-a44d1cebec3e" ], + "x-ms-request-id": [ "5a4c2953-12a5-4e2a-b79c-d657fbad034d" ], "X-Content-Type-Options": [ "nosniff" ], "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], "Access-Control-Expose-Headers": [ "Request-Context" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "Server": [ "Microsoft-IIS/10.0" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11973" ], - "x-ms-correlation-request-id": [ "8f91e824-d593-4254-98e7-be199140bc9a" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084322Z:8f91e824-d593-4254-98e7-be199140bc9a" ], - "Date": [ "Wed, 10 Nov 2021 08:43:21 GMT" ] + "x-ms-ratelimit-remaining-subscription-reads": [ "11993" ], + "x-ms-correlation-request-id": [ "f7cd92ee-e826-4f63-b466-9d0ff8d2e1c1" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034639Z:f7cd92ee-e826-4f63-b466-9d0ff8d2e1c1" ], + "Date": [ "Tue, 10 May 2022 03:46:38 GMT" ] }, "ContentHeaders": { "Content-Length": [ "1145" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh\",\"name\":\"standardwebtest-f62wc7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000bf9d-0000-0600-0000-618b844d0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-f62wc7-pwsh\",\"Name\":\"standardwebtest-f62wc7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh\",\"name\":\"standardwebtest-p7kj09-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f600a20d-0000-0600-0000-6279dfe90000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-p7kj09-pwsh\",\"Name\":\"standardwebtest-p7kj09-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", "isContentBase64": false } }, - "Get-AzApplicationInsightsWebTest+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview+2": { + "Get-AzApplicationInsightsWebTest+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "6" ], - "x-ms-client-request-id": [ "5af401d1-e1c7-420c-8791-2a392194ad7c" ], + "x-ms-unique-id": [ "15" ], + "x-ms-client-request-id": [ "e71eebd3-0be0-43d0-bd6e-a51fc377e4e0" ], "CommandName": [ "Get-AzApplicationInsightsWebTest" ], "FullCommandName": [ "Get-AzApplicationInsightsWebTest_GetViaIdentity" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -236,24 +236,24 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-request-id": [ "5af401d1-e1c7-420c-8791-2a392194ad7c" ], + "x-ms-request-id": [ "e71eebd3-0be0-43d0-bd6e-a51fc377e4e0" ], "X-Content-Type-Options": [ "nosniff" ], "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], "Access-Control-Expose-Headers": [ "Request-Context" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "Server": [ "Microsoft-IIS/10.0" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11972" ], - "x-ms-correlation-request-id": [ "6209b248-833d-48c2-9f37-8ac87ce43130" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084323Z:6209b248-833d-48c2-9f37-8ac87ce43130" ], - "Date": [ "Wed, 10 Nov 2021 08:43:22 GMT" ] + "x-ms-ratelimit-remaining-subscription-reads": [ "11992" ], + "x-ms-correlation-request-id": [ "e63b1f50-7ecb-4770-9321-fa98ac836c98" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034640Z:e63b1f50-7ecb-4770-9321-fa98ac836c98" ], + "Date": [ "Tue, 10 May 2022 03:46:40 GMT" ] }, "ContentHeaders": { "Content-Length": [ "1145" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh\",\"name\":\"standardwebtest-f62wc7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000bf9d-0000-0600-0000-618b844d0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-f62wc7-pwsh\",\"Name\":\"standardwebtest-f62wc7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh\",\"name\":\"standardwebtest-p7kj09-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f600a20d-0000-0600-0000-6279dfe90000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-p7kj09-pwsh\",\"Name\":\"standardwebtest-p7kj09-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", "isContentBase64": false } } diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsights.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsights.Tests.ps1 new file mode 100644 index 000000000000..440f274de3c4 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsights.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzApplicationInsights')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzApplicationInsights.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzApplicationInsights' { + It '__AllParameterSets' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsApiKey.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsApiKey.Tests.ps1 new file mode 100644 index 000000000000..e98046198fde --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsApiKey.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzApplicationInsightsApiKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzApplicationInsightsApiKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzApplicationInsightsApiKey' { + It 'ComponentNameParameterSet' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsContinuousExport.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsContinuousExport.Tests.ps1 new file mode 100644 index 000000000000..2ff465aac479 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsContinuousExport.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzApplicationInsightsContinuousExport')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzApplicationInsightsContinuousExport.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzApplicationInsightsContinuousExport' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..5df20e5b97d6 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzApplicationInsightsLinkedStorageAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzApplicationInsightsLinkedStorageAccount.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzApplicationInsightsLinkedStorageAccount' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsWebTest.Recording.json b/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsWebTest.Recording.json index 483e06b52f4a..6f5d88fb271a 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsWebTest.Recording.json +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/New-AzApplicationInsightsWebTest.Recording.json @@ -1,9 +1,9 @@ { - "New-AzApplicationInsightsWebTest+[NoContext]+CreateStandard+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-xyhebs-pwsh?api-version=2018-05-01-preview+1": { + "New-AzApplicationInsightsWebTest+[NoContext]+CreateStandard+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-hpscby-pwsh?api-version=2018-05-01-preview+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-xyhebs-pwsh?api-version=2018-05-01-preview", - "Content": "{\r\n \"location\": \"westus2\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\": \"Resource\"\r\n },\r\n \"properties\": {\r\n \"Request\": {\r\n \"RequestUrl\": \"https://docs.microsoft.com/\",\r\n \"HttpVerb\": \"GET\"\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": 200\r\n },\r\n \"Name\": \"standardwebtest-xyhebs-pwsh\",\r\n \"Enabled\": true,\r\n \"Frequency\": 300,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": \"emea-nl-ams-azr\"\r\n },\r\n {\r\n \"Id\": \"us-ca-sjc-azr\"\r\n }\r\n ]\r\n }\r\n}", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-hpscby-pwsh?api-version=2018-05-01-preview", + "Content": "{\r\n \"location\": \"westus2\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\": \"Resource\"\r\n },\r\n \"properties\": {\r\n \"Request\": {\r\n \"RequestUrl\": \"https://docs.microsoft.com/\",\r\n \"HttpVerb\": \"GET\"\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": 200\r\n },\r\n \"Name\": \"standardwebtest-hpscby-pwsh\",\r\n \"Enabled\": true,\r\n \"Frequency\": 300,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": \"emea-nl-ams-azr\"\r\n },\r\n {\r\n \"Id\": \"us-ca-sjc-azr\"\r\n }\r\n ]\r\n }\r\n}", "isContentBase64": false, "Headers": { }, @@ -17,40 +17,40 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-request-id": [ "394e5004-dd70-4082-9cc2-3d5163782b5b" ], + "x-ms-request-id": [ "f1559fb7-9b95-4139-81a5-469dd597a456" ], "X-Content-Type-Options": [ "nosniff" ], "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], "Access-Control-Expose-Headers": [ "Request-Context" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "Server": [ "Microsoft-IIS/10.0" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-writes": [ "1193" ], - "x-ms-correlation-request-id": [ "a352aed4-1e1e-4358-9522-95d106cd8e68" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084344Z:a352aed4-1e1e-4358-9522-95d106cd8e68" ], - "Date": [ "Wed, 10 Nov 2021 08:43:44 GMT" ] + "x-ms-ratelimit-remaining-subscription-writes": [ "1194" ], + "x-ms-correlation-request-id": [ "20e3167b-4b04-45ca-b1ae-f1b72b5c7c07" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034648Z:20e3167b-4b04-45ca-b1ae-f1b72b5c7c07" ], + "Date": [ "Tue, 10 May 2022 03:46:47 GMT" ] }, "ContentHeaders": { "Content-Length": [ "1145" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-xyhebs-pwsh\",\"name\":\"standardwebtest-xyhebs-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"00003c9e-0000-0600-0000-618b863e0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-xyhebs-pwsh\",\"Name\":\"standardwebtest-xyhebs-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-hpscby-pwsh\",\"name\":\"standardwebtest-hpscby-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f600b011-0000-0600-0000-6279e0260000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-hpscby-pwsh\",\"Name\":\"standardwebtest-hpscby-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", "isContentBase64": false } }, - "New-AzApplicationInsightsWebTest+[NoContext]+CreateStandard+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-xyhebs-pwsh?api-version=2018-05-01-preview+2": { + "New-AzApplicationInsightsWebTest+[NoContext]+CreateStandard+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-hpscby-pwsh?api-version=2018-05-01-preview+2": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-xyhebs-pwsh?api-version=2018-05-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-hpscby-pwsh?api-version=2018-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "2" ], - "x-ms-client-request-id": [ "b554073d-5937-495d-87cc-79bf3e3ff265" ], + "x-ms-unique-id": [ "17" ], + "x-ms-client-request-id": [ "dcbd79e5-af23-4aaa-8f48-9ed253f23b46" ], "CommandName": [ "Remove-AzApplicationInsightsWebTest" ], "FullCommandName": [ "Remove-AzApplicationInsightsWebTest_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -61,17 +61,17 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-request-id": [ "b554073d-5937-495d-87cc-79bf3e3ff265" ], + "x-ms-request-id": [ "dcbd79e5-af23-4aaa-8f48-9ed253f23b46" ], "X-Content-Type-Options": [ "nosniff" ], "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], "Access-Control-Expose-Headers": [ "Request-Context" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "Server": [ "Microsoft-IIS/10.0" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-deletes": [ "14997" ], - "x-ms-correlation-request-id": [ "e4894fcd-7368-48a3-8c1e-edc097389807" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084349Z:e4894fcd-7368-48a3-8c1e-edc097389807" ], - "Date": [ "Wed, 10 Nov 2021 08:43:48 GMT" ] + "x-ms-ratelimit-remaining-subscription-deletes": [ "14998" ], + "x-ms-correlation-request-id": [ "182abd43-cee1-40bc-a2c5-91d8f64cbbd7" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034651Z:182abd43-cee1-40bc-a2c5-91d8f64cbbd7" ], + "Date": [ "Tue, 10 May 2022 03:46:50 GMT" ] }, "ContentHeaders": { "Expires": [ "-1" ], @@ -81,19 +81,19 @@ "isContentBase64": false } }, - "New-AzApplicationInsightsWebTest+[NoContext]+CreateStandard+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview+3": { + "New-AzApplicationInsightsWebTest+[NoContext]+CreateStandard+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "3" ], - "x-ms-client-request-id": [ "f2d2ace3-e3e5-4e7f-bb72-6d0b72036863" ], + "x-ms-unique-id": [ "18" ], + "x-ms-client-request-id": [ "292eabc7-be53-4b06-aed8-f005f23857ed" ], "CommandName": [ "Get-AzApplicationInsightsWebTest" ], "FullCommandName": [ "Get-AzApplicationInsightsWebTest_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -104,29 +104,29 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-original-request-ids": [ "f2d2ace3-e3e5-4e7f-bb72-6d0b72036863", "f2d2ace3-e3e5-4e7f-bb72-6d0b72036863" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11979" ], - "x-ms-request-id": [ "32788ea6-5c0a-412d-9a65-1195d4b45237" ], - "x-ms-correlation-request-id": [ "32788ea6-5c0a-412d-9a65-1195d4b45237" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084351Z:32788ea6-5c0a-412d-9a65-1195d4b45237" ], + "x-ms-original-request-ids": [ "292eabc7-be53-4b06-aed8-f005f23857ed", "292eabc7-be53-4b06-aed8-f005f23857ed" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11991" ], + "x-ms-request-id": [ "1a8938e0-9d88-41fa-bad6-355f1d95b92f" ], + "x-ms-correlation-request-id": [ "1a8938e0-9d88-41fa-bad6-355f1d95b92f" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034652Z:1a8938e0-9d88-41fa-bad6-355f1d95b92f" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": [ "nosniff" ], - "Date": [ "Wed, 10 Nov 2021 08:43:51 GMT" ] + "Date": [ "Tue, 10 May 2022 03:46:51 GMT" ] }, "ContentHeaders": { "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ], "Content-Length": [ "1157" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh\",\"name\":\"standardwebtest-f62wc7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000bf9d-0000-0600-0000-618b844d0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-f62wc7-pwsh\",\"Name\":\"standardwebtest-f62wc7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh\",\"name\":\"standardwebtest-p7kj09-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f600a20d-0000-0600-0000-6279dfe90000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-p7kj09-pwsh\",\"Name\":\"standardwebtest-p7kj09-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}]}", "isContentBase64": false } }, - "New-AzApplicationInsightsWebTest+[NoContext]+CreatePing+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/basicwebtest-sytr2v-pwsh?api-version=2018-05-01-preview+1": { + "New-AzApplicationInsightsWebTest+[NoContext]+CreatePing+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/basicwebtest-aebyvh-pwsh?api-version=2018-05-01-preview+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/basicwebtest-sytr2v-pwsh?api-version=2018-05-01-preview", - "Content": "{\r\n \"location\": \"westus2\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\": \"Resource\"\r\n },\r\n \"properties\": {\r\n \"Configuration\": {\r\n \"WebTest\": \"\\u003cWebTest Name=\\\"basicwebtest-sytr2v-pwsh\\\" Id=\\\"5bcf922d-392c-4882-99e5-71ee6e85648c\\\" Enabled=\\\"True\\\" CssProjectStructure=\\\"\\\" CssIteration=\\\"\\\" Timeout=\\\"120\\\" WorkItemIds=\\\"\\\" xmlns=\\\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\\\" Description=\\\"\\\" CredentialUserName=\\\"\\\" CredentialPassword=\\\"\\\" PreAuthenticate=\\\"True\\\" Proxy=\\\"default\\\" StopOnError=\\\"False\\\" RecordedResultFile=\\\"\\\" ResultsLocale=\\\"\\\"\\u003e \\r\\n \\u003cItems\\u003e \\r\\n \\u003cRequest Method=\\\"Get\\\" Guid=\\\"0e2a2b9d-787d-49b5-9a34-d65a8f067a4f\\\" Version=\\\"1.1\\\" Url=\\\"https://docs.microsoft.com/\\\" ThinkTime=\\\"0\\\" Timeout=\\\"120\\\" ParseDependentRequests=\\\"\\\" FollowRedirects=\\\"True\\\" RecordResult=\\\"True\\\" Cache=\\\"False\\\" ResponseTimeGoal=\\\"0\\\" Encoding=\\\"utf-8\\\" ExpectedHttpStatusCode=\\\"200\\\" ExpectedResponseUrl=\\\"\\\" ReportingName=\\\"\\\" IgnoreHttpStatusCode=\\\"False\\\" /\\u003e \\r\\n \\u003c/Items\\u003e\\r\\n \\r\\n \\u003c/WebTest\\u003e\"\r\n },\r\n \"Name\": \"basicwebtest-sytr2v-pwsh\",\r\n \"Enabled\": true,\r\n \"Frequency\": 300,\r\n \"Timeout\": 120,\r\n \"Kind\": \"ping\",\r\n \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": \"emea-nl-ams-azr\"\r\n },\r\n {\r\n \"Id\": \"us-ca-sjc-azr\"\r\n }\r\n ]\r\n }\r\n}", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/basicwebtest-aebyvh-pwsh?api-version=2018-05-01-preview", + "Content": "{\r\n \"location\": \"westus2\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\": \"Resource\"\r\n },\r\n \"properties\": {\r\n \"Configuration\": {\r\n \"WebTest\": \"\\u003cWebTest Name=\\\"basicwebtest-aebyvh-pwsh\\\" Id=\\\"4c78b7fc-fba1-4f6c-b961-17a58db30355\\\" Enabled=\\\"True\\\" CssProjectStructure=\\\"\\\" CssIteration=\\\"\\\" Timeout=\\\"120\\\" WorkItemIds=\\\"\\\" xmlns=\\\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\\\" Description=\\\"\\\" CredentialUserName=\\\"\\\" CredentialPassword=\\\"\\\" PreAuthenticate=\\\"True\\\" Proxy=\\\"default\\\" StopOnError=\\\"False\\\" RecordedResultFile=\\\"\\\" ResultsLocale=\\\"\\\"\\u003e \\r\\n \\u003cItems\\u003e \\r\\n \\u003cRequest Method=\\\"Get\\\" Guid=\\\"e1b423ab-45ff-4c48-881f-7e570054979a\\\" Version=\\\"1.1\\\" Url=\\\"https://docs.microsoft.com/\\\" ThinkTime=\\\"0\\\" Timeout=\\\"120\\\" ParseDependentRequests=\\\"\\\" FollowRedirects=\\\"True\\\" RecordResult=\\\"True\\\" Cache=\\\"False\\\" ResponseTimeGoal=\\\"0\\\" Encoding=\\\"utf-8\\\" ExpectedHttpStatusCode=\\\"200\\\" ExpectedResponseUrl=\\\"\\\" ReportingName=\\\"\\\" IgnoreHttpStatusCode=\\\"False\\\" /\\u003e \\r\\n \\u003c/Items\\u003e\\r\\n \\r\\n \\u003c/WebTest\\u003e\"\r\n },\r\n \"Name\": \"basicwebtest-aebyvh-pwsh\",\r\n \"Enabled\": true,\r\n \"Frequency\": 300,\r\n \"Timeout\": 120,\r\n \"Kind\": \"ping\",\r\n \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": \"emea-nl-ams-azr\"\r\n },\r\n {\r\n \"Id\": \"us-ca-sjc-azr\"\r\n }\r\n ]\r\n }\r\n}", "isContentBase64": false, "Headers": { }, @@ -140,40 +140,40 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-request-id": [ "7f69cd39-46b4-4003-b235-2d8207a14f27" ], + "x-ms-request-id": [ "3853b9da-556a-42bc-b3a2-f48bee3d2292" ], "X-Content-Type-Options": [ "nosniff" ], "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], "Access-Control-Expose-Headers": [ "Request-Context" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "Server": [ "Microsoft-IIS/10.0" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-writes": [ "1192" ], - "x-ms-correlation-request-id": [ "e082e9d0-5861-4868-9d50-e9c41b26d260" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084358Z:e082e9d0-5861-4868-9d50-e9c41b26d260" ], - "Date": [ "Wed, 10 Nov 2021 08:43:57 GMT" ] + "x-ms-ratelimit-remaining-subscription-writes": [ "1193" ], + "x-ms-correlation-request-id": [ "8aebc04a-2514-41f0-a2d8-f19fd84b9bcd" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034658Z:8aebc04a-2514-41f0-a2d8-f19fd84b9bcd" ], + "Date": [ "Tue, 10 May 2022 03:46:57 GMT" ] }, "ContentHeaders": { "Content-Length": [ "2016" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/basicwebtest-sytr2v-pwsh\",\"name\":\"basicwebtest-sytr2v-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"00003d9e-0000-0600-0000-618b864c0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"basicwebtest-sytr2v-pwsh\",\"Name\":\"basicwebtest-sytr2v-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"ping\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":{\"WebTest\":\"\u003cWebTest Name=\\\"basicwebtest-sytr2v-pwsh\\\" Id=\\\"5bcf922d-392c-4882-99e5-71ee6e85648c\\\" Enabled=\\\"True\\\" CssProjectStructure=\\\"\\\" CssIteration=\\\"\\\" Timeout=\\\"120\\\" WorkItemIds=\\\"\\\" xmlns=\\\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\\\" Description=\\\"\\\" CredentialUserName=\\\"\\\" CredentialPassword=\\\"\\\" PreAuthenticate=\\\"True\\\" Proxy=\\\"default\\\" StopOnError=\\\"False\\\" RecordedResultFile=\\\"\\\" ResultsLocale=\\\"\\\"\u003e \\r\\n \u003cItems\u003e \\r\\n \u003cRequest Method=\\\"Get\\\" Guid=\\\"0e2a2b9d-787d-49b5-9a34-d65a8f067a4f\\\" Version=\\\"1.1\\\" Url=\\\"https://docs.microsoft.com/\\\" ThinkTime=\\\"0\\\" Timeout=\\\"120\\\" ParseDependentRequests=\\\"\\\" FollowRedirects=\\\"True\\\" RecordResult=\\\"True\\\" Cache=\\\"False\\\" ResponseTimeGoal=\\\"0\\\" Encoding=\\\"utf-8\\\" ExpectedHttpStatusCode=\\\"200\\\" ExpectedResponseUrl=\\\"\\\" ReportingName=\\\"\\\" IgnoreHttpStatusCode=\\\"False\\\" /\u003e \\r\\n \u003c/Items\u003e\\r\\n \\r\\n \u003c/WebTest\u003e\"},\"Request\":null,\"ValidationRules\":null,\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/basicwebtest-aebyvh-pwsh\",\"name\":\"basicwebtest-aebyvh-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f6004212-0000-0600-0000-6279e0300000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"basicwebtest-aebyvh-pwsh\",\"Name\":\"basicwebtest-aebyvh-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"ping\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":{\"WebTest\":\"\u003cWebTest Name=\\\"basicwebtest-aebyvh-pwsh\\\" Id=\\\"4c78b7fc-fba1-4f6c-b961-17a58db30355\\\" Enabled=\\\"True\\\" CssProjectStructure=\\\"\\\" CssIteration=\\\"\\\" Timeout=\\\"120\\\" WorkItemIds=\\\"\\\" xmlns=\\\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\\\" Description=\\\"\\\" CredentialUserName=\\\"\\\" CredentialPassword=\\\"\\\" PreAuthenticate=\\\"True\\\" Proxy=\\\"default\\\" StopOnError=\\\"False\\\" RecordedResultFile=\\\"\\\" ResultsLocale=\\\"\\\"\u003e \\r\\n \u003cItems\u003e \\r\\n \u003cRequest Method=\\\"Get\\\" Guid=\\\"e1b423ab-45ff-4c48-881f-7e570054979a\\\" Version=\\\"1.1\\\" Url=\\\"https://docs.microsoft.com/\\\" ThinkTime=\\\"0\\\" Timeout=\\\"120\\\" ParseDependentRequests=\\\"\\\" FollowRedirects=\\\"True\\\" RecordResult=\\\"True\\\" Cache=\\\"False\\\" ResponseTimeGoal=\\\"0\\\" Encoding=\\\"utf-8\\\" ExpectedHttpStatusCode=\\\"200\\\" ExpectedResponseUrl=\\\"\\\" ReportingName=\\\"\\\" IgnoreHttpStatusCode=\\\"False\\\" /\u003e \\r\\n \u003c/Items\u003e\\r\\n \\r\\n \u003c/WebTest\u003e\"},\"Request\":null,\"ValidationRules\":null,\"provisioningState\":\"Succeeded\"}}", "isContentBase64": false } }, - "New-AzApplicationInsightsWebTest+[NoContext]+CreatePing+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/basicwebtest-sytr2v-pwsh?api-version=2018-05-01-preview+2": { + "New-AzApplicationInsightsWebTest+[NoContext]+CreatePing+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/basicwebtest-aebyvh-pwsh?api-version=2018-05-01-preview+2": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/basicwebtest-sytr2v-pwsh?api-version=2018-05-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/basicwebtest-aebyvh-pwsh?api-version=2018-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "5" ], - "x-ms-client-request-id": [ "be153380-d611-4072-ac7f-59957d30071c" ], + "x-ms-unique-id": [ "20" ], + "x-ms-client-request-id": [ "a18c001e-8dab-44c6-8491-795a191fd37e" ], "CommandName": [ "Remove-AzApplicationInsightsWebTest" ], "FullCommandName": [ "Remove-AzApplicationInsightsWebTest_DeleteViaIdentity" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -184,17 +184,17 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-request-id": [ "be153380-d611-4072-ac7f-59957d30071c" ], + "x-ms-request-id": [ "a18c001e-8dab-44c6-8491-795a191fd37e" ], "X-Content-Type-Options": [ "nosniff" ], "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], "Access-Control-Expose-Headers": [ "Request-Context" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "Server": [ "Microsoft-IIS/10.0" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-deletes": [ "14996" ], - "x-ms-correlation-request-id": [ "05de4490-6495-44ed-9bd4-31952288332a" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084401Z:05de4490-6495-44ed-9bd4-31952288332a" ], - "Date": [ "Wed, 10 Nov 2021 08:44:00 GMT" ] + "x-ms-ratelimit-remaining-subscription-deletes": [ "14997" ], + "x-ms-correlation-request-id": [ "eca3725a-0bbd-4695-b4ae-dff28e419785" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034702Z:eca3725a-0bbd-4695-b4ae-dff28e419785" ], + "Date": [ "Tue, 10 May 2022 03:47:01 GMT" ] }, "ContentHeaders": { "Expires": [ "-1" ], @@ -204,19 +204,19 @@ "isContentBase64": false } }, - "New-AzApplicationInsightsWebTest+[NoContext]+CreatePing+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview+3": { + "New-AzApplicationInsightsWebTest+[NoContext]+CreatePing+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests?api-version=2018-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "6" ], - "x-ms-client-request-id": [ "ff31e8ee-7e83-4d7f-ba19-10072b578204" ], + "x-ms-unique-id": [ "21" ], + "x-ms-client-request-id": [ "04445adc-14de-4664-b70f-3fc6f8957bae" ], "CommandName": [ "Get-AzApplicationInsightsWebTest" ], "FullCommandName": [ "Get-AzApplicationInsightsWebTest_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -227,21 +227,21 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-original-request-ids": [ "ff31e8ee-7e83-4d7f-ba19-10072b578204", "ff31e8ee-7e83-4d7f-ba19-10072b578204" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11978" ], - "x-ms-request-id": [ "0ed90dea-4420-486b-941f-f286d512c26e" ], - "x-ms-correlation-request-id": [ "0ed90dea-4420-486b-941f-f286d512c26e" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084402Z:0ed90dea-4420-486b-941f-f286d512c26e" ], + "x-ms-original-request-ids": [ "04445adc-14de-4664-b70f-3fc6f8957bae", "04445adc-14de-4664-b70f-3fc6f8957bae" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11990" ], + "x-ms-request-id": [ "3ee79ad4-8a75-4c23-a39d-30314ea976ae" ], + "x-ms-correlation-request-id": [ "3ee79ad4-8a75-4c23-a39d-30314ea976ae" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034703Z:3ee79ad4-8a75-4c23-a39d-30314ea976ae" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": [ "nosniff" ], - "Date": [ "Wed, 10 Nov 2021 08:44:01 GMT" ] + "Date": [ "Tue, 10 May 2022 03:47:02 GMT" ] }, "ContentHeaders": { "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ], "Content-Length": [ "1157" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh\",\"name\":\"standardwebtest-f62wc7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"0000bf9d-0000-0600-0000-618b844d0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-f62wc7-pwsh\",\"Name\":\"standardwebtest-f62wc7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh\",\"name\":\"standardwebtest-p7kj09-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f600a20d-0000-0600-0000-6279dfe90000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-p7kj09-pwsh\",\"Name\":\"standardwebtest-p7kj09-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}]}", "isContentBase64": false } } diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsights.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsights.Tests.ps1 new file mode 100644 index 000000000000..81c53571b525 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsights.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzApplicationInsights')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzApplicationInsights.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzApplicationInsights' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsightsApiKey.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsightsApiKey.Tests.ps1 new file mode 100644 index 000000000000..e7874f19312d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsightsApiKey.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzApplicationInsightsApiKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzApplicationInsightsApiKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzApplicationInsightsApiKey' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsightsContinuousExport.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsightsContinuousExport.Tests.ps1 new file mode 100644 index 000000000000..bb02cb1d6e4e --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsightsContinuousExport.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzApplicationInsightsContinuousExport')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzApplicationInsightsContinuousExport.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzApplicationInsightsContinuousExport' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..6e808dcfd5b9 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Remove-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzApplicationInsightsLinkedStorageAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzApplicationInsightsLinkedStorageAccount.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzApplicationInsightsLinkedStorageAccount' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsights.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsights.Tests.ps1 new file mode 100644 index 000000000000..d607bc58a71d --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsights.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Set-AzApplicationInsights')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Set-AzApplicationInsights.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Set-AzApplicationInsights' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsContinuousExport.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsContinuousExport.Tests.ps1 new file mode 100644 index 000000000000..3f9aa2118c30 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsContinuousExport.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Set-AzApplicationInsightsContinuousExport')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Set-AzApplicationInsightsContinuousExport.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Set-AzApplicationInsightsContinuousExport' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsDailyCap.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsDailyCap.Tests.ps1 new file mode 100644 index 000000000000..efb149ef8043 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsDailyCap.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Set-AzApplicationInsightsDailyCap')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Set-AzApplicationInsightsDailyCap.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Set-AzApplicationInsightsDailyCap' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsPricingPlan.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsPricingPlan.Tests.ps1 new file mode 100644 index 000000000000..d9329463e447 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsPricingPlan.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Set-AzApplicationInsightsPricingPlan')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Set-AzApplicationInsightsPricingPlan.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Set-AzApplicationInsightsPricingPlan' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsWebTest.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsWebTest.Tests.ps1 new file mode 100644 index 000000000000..110fa8750898 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Set-AzApplicationInsightsWebTest.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Set-AzApplicationInsightsWebTest')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Set-AzApplicationInsightsWebTest.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Set-AzApplicationInsightsWebTest' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Update-AzApplicationInsights.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Update-AzApplicationInsights.Tests.ps1 new file mode 100644 index 000000000000..01ce0f3c88c0 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Update-AzApplicationInsights.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzApplicationInsights')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzApplicationInsights.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzApplicationInsights' { + It '__AllParameterSets' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Update-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Update-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..4c1613dcc049 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Update-AzApplicationInsightsLinkedStorageAccount.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzApplicationInsightsLinkedStorageAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzApplicationInsightsLinkedStorageAccount.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzApplicationInsightsLinkedStorageAccount' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Update-AzApplicationInsightsWebTestTag.Recording.json b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Update-AzApplicationInsightsWebTestTag.Recording.json index 59f86efe4e01..be0ef9867679 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/test/Update-AzApplicationInsightsWebTestTag.Recording.json +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/Update-AzApplicationInsightsWebTestTag.Recording.json @@ -1,9 +1,9 @@ { - "Update-AzApplicationInsightsWebTestTag+[NoContext]+UpdateExpanded+$PATCH+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview+1": { + "Update-AzApplicationInsightsWebTestTag+[NoContext]+UpdateExpanded+$PATCH+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview+1": { "Request": { "Method": "PATCH", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview", - "Content": "{\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-zid72t-pwsh\": \"Resource\"\r\n }\r\n}", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview", + "Content": "{\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-q31ebc-pwsh\": \"Resource\"\r\n }\r\n}", "isContentBase64": false, "Headers": { }, @@ -17,40 +17,40 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-request-id": [ "dc0d5ed7-7794-4c62-b41e-41b35cb35369" ], + "x-ms-request-id": [ "5f1da18b-0c39-46d7-a440-0548ef5508c3" ], "X-Content-Type-Options": [ "nosniff" ], "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], "Access-Control-Expose-Headers": [ "Request-Context" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "Server": [ "Microsoft-IIS/10.0" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-writes": [ "1199" ], - "x-ms-correlation-request-id": [ "daacda5a-cb1a-478f-8947-fba073c797ef" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084537Z:daacda5a-cb1a-478f-8947-fba073c797ef" ], - "Date": [ "Wed, 10 Nov 2021 08:45:36 GMT" ] + "x-ms-ratelimit-remaining-subscription-writes": [ "1192" ], + "x-ms-correlation-request-id": [ "660f2ebd-9ac0-491d-a74c-f89a9f81da69" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034710Z:660f2ebd-9ac0-491d-a74c-f89a9f81da69" ], + "Date": [ "Tue, 10 May 2022 03:47:10 GMT" ] }, "ContentHeaders": { "Content-Length": [ "1145" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh\",\"name\":\"standardwebtest-f62wc7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-zid72t-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"00004d9e-0000-0600-0000-618b86ad0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-f62wc7-pwsh\",\"Name\":\"standardwebtest-f62wc7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh\",\"name\":\"standardwebtest-p7kj09-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-q31ebc-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f600fc12-0000-0600-0000-6279e03d0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-p7kj09-pwsh\",\"Name\":\"standardwebtest-p7kj09-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", "isContentBase64": false } }, - "Update-AzApplicationInsightsWebTestTag+[NoContext]+UpdateViaIdentityExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview+1": { + "Update-AzApplicationInsightsWebTestTag+[NoContext]+UpdateViaIdentityExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "2" ], - "x-ms-client-request-id": [ "ca8ecdc5-6a05-48a8-b196-7e42c4369396" ], + "x-ms-unique-id": [ "23" ], + "x-ms-client-request-id": [ "e87f39ed-11cb-47dc-aa77-3c66984693eb" ], "CommandName": [ "Get-AzApplicationInsightsWebTest" ], "FullCommandName": [ "Get-AzApplicationInsightsWebTest_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "Az.ApplicationInsights/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -61,32 +61,32 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-request-id": [ "ca8ecdc5-6a05-48a8-b196-7e42c4369396" ], + "x-ms-request-id": [ "e87f39ed-11cb-47dc-aa77-3c66984693eb" ], "X-Content-Type-Options": [ "nosniff" ], "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], "Access-Control-Expose-Headers": [ "Request-Context" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "Server": [ "Microsoft-IIS/10.0" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11997" ], - "x-ms-correlation-request-id": [ "36c03e64-e538-47af-a146-8c85fc38eb63" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084539Z:36c03e64-e538-47af-a146-8c85fc38eb63" ], - "Date": [ "Wed, 10 Nov 2021 08:45:38 GMT" ] + "x-ms-ratelimit-remaining-subscription-reads": [ "11989" ], + "x-ms-correlation-request-id": [ "9d38f3a7-7dc8-44be-8e5e-7b6c2b81c378" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034712Z:9d38f3a7-7dc8-44be-8e5e-7b6c2b81c378" ], + "Date": [ "Tue, 10 May 2022 03:47:11 GMT" ] }, "ContentHeaders": { "Content-Length": [ "1145" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh\",\"name\":\"standardwebtest-f62wc7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-zid72t-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"00004d9e-0000-0600-0000-618b86ad0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-f62wc7-pwsh\",\"Name\":\"standardwebtest-f62wc7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh\",\"name\":\"standardwebtest-p7kj09-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-q31ebc-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f600fc12-0000-0600-0000-6279e03d0000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-p7kj09-pwsh\",\"Name\":\"standardwebtest-p7kj09-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", "isContentBase64": false } }, - "Update-AzApplicationInsightsWebTestTag+[NoContext]+UpdateViaIdentityExpanded+$PATCH+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview+2": { + "Update-AzApplicationInsightsWebTestTag+[NoContext]+UpdateViaIdentityExpanded+$PATCH+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview+2": { "Request": { "Method": "PATCH", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh?api-version=2018-05-01-preview", - "Content": "{\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\": \"Resource\"\r\n }\r\n}", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh?api-version=2018-05-01-preview", + "Content": "{\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\": \"Resource\"\r\n }\r\n}", "isContentBase64": false, "Headers": { }, @@ -100,24 +100,24 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "x-ms-request-id": [ "88703081-1667-4af3-8b2c-798f57dc88bb" ], + "x-ms-request-id": [ "c9d2a4ab-5d00-4616-8f16-bbe8fd7851e3" ], "X-Content-Type-Options": [ "nosniff" ], "Request-Context": [ "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" ], "Access-Control-Expose-Headers": [ "Request-Context" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "Server": [ "Microsoft-IIS/10.0" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-writes": [ "1198" ], - "x-ms-correlation-request-id": [ "5e9a56d8-3a70-43d1-b47d-6979832dfe11" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20211110T084544Z:5e9a56d8-3a70-43d1-b47d-6979832dfe11" ], - "Date": [ "Wed, 10 Nov 2021 08:45:44 GMT" ] + "x-ms-ratelimit-remaining-subscription-writes": [ "1191" ], + "x-ms-correlation-request-id": [ "79352b2f-fea4-4e76-a9fd-56288339ffb0" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220510T034715Z:79352b2f-fea4-4e76-a9fd-56288339ffb0" ], + "Date": [ "Tue, 10 May 2022 03:47:14 GMT" ] }, "ContentHeaders": { "Content-Length": [ "1145" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/webtests/standardwebtest-f62wc7-pwsh\",\"name\":\"standardwebtest-f62wc7-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"00004f9e-0000-0600-0000-618b86b60000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-f62wc7-pwsh\",\"Name\":\"standardwebtest-f62wc7-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/webtests/standardwebtest-p7kj09-pwsh\",\"name\":\"standardwebtest-p7kj09-pwsh\",\"type\":\"microsoft.insights/webtests\",\"location\":\"westus2\",\"tags\":{\"hidden-link:/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh\":\"Resource\"},\"kind\":null,\"etag\":\"\\\"f6004813-0000-0600-0000-6279e0420000\\\"\",\"properties\":{\"SyntheticMonitorId\":\"standardwebtest-p7kj09-pwsh\",\"Name\":\"standardwebtest-p7kj09-pwsh\",\"Description\":null,\"Enabled\":true,\"Frequency\":300,\"Timeout\":120,\"Kind\":\"standard\",\"RetryEnabled\":true,\"Locations\":[{\"Id\":\"emea-nl-ams-azr\"},{\"Id\":\"us-ca-sjc-azr\"}],\"Configuration\":null,\"Request\":{\"RequestUrl\":\"https://docs.microsoft.com/\",\"Headers\":null,\"HttpVerb\":\"GET\",\"RequestBody\":null,\"ParseDependentRequests\":null,\"FollowRedirects\":null},\"ValidationRules\":{\"ExpectedHttpStatusCode\":200,\"IgnoreHttpStatusCode\":null,\"ContentValidation\":null,\"SSLCheck\":null,\"SSLCertRemainingLifetimeCheck\":null},\"provisioningState\":\"Succeeded\"}}", "isContentBase64": false } } diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/env.json b/src/ApplicationInsights/ApplicationInsights.Autorest/test/env.json index b011c30175d6..00cb4aa92e10 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/test/env.json +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/env.json @@ -1,18 +1,19 @@ { - "geoLocation04": "emea-se-sto-edge", - "standardWebTest01": "standardwebtest-f62wc7-pwsh", - "basicWebTest03": "basicwebtest-sytr2v-pwsh", - "standardWebTest02": "standardwebtest-xyhebs-pwsh", - "geoLocation03": "emea-ru-msa-edge", - "basicWebTest04": "basicwebtest-ufxtcy-pwsh", - "appInsights02Id": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-zid72t-pwsh", + "basicWebTest03": "basicwebtest-aebyvh-pwsh", "SubscriptionId": "9e223dbe-3399-4e19-88eb-0975f02ac87f", - "location": "westus2", - "appInsights01Id": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-wo60fd-test/providers/microsoft.insights/components/appInsights-e39y2j-pwsh", - "resourceGroup": "appInsights-wo60fd-test", - "appInsights02": "appInsights-zid72t-pwsh", - "geoLocation01": "emea-nl-ams-azr", "geoLocation02": "us-ca-sjc-azr", + "appInsights01Id": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-a5empk-pwsh", + "geoLocation03": "emea-ru-msa-edge", + "standardWebTest01": "standardwebtest-p7kj09-pwsh", + "component1": "componentfu7emc", + "appInsights02": "appInsights-q31ebc-pwsh", + "appInsights01": "appInsights-a5empk-pwsh", + "basicWebTest04": "basicwebtest-24kd0o-pwsh", + "resourceGroup": "appInsights-g4edrv-test", + "appInsights02Id": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/appInsights-g4edrv-test/providers/microsoft.insights/components/appInsights-q31ebc-pwsh", + "standardWebTest02": "standardwebtest-hpscby-pwsh", "Tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "appInsights01": "appInsights-e39y2j-pwsh" + "location": "westus2", + "geoLocation01": "emea-nl-ams-azr", + "geoLocation04": "emea-se-sto-edge" } diff --git a/src/ApplicationInsights/ApplicationInsights.Autorest/test/utils.ps1 b/src/ApplicationInsights/ApplicationInsights.Autorest/test/utils.ps1 index 81b4f609606c..dd385db6e602 100644 --- a/src/ApplicationInsights/ApplicationInsights.Autorest/test/utils.ps1 +++ b/src/ApplicationInsights/ApplicationInsights.Autorest/test/utils.ps1 @@ -61,6 +61,9 @@ function setupEnv() { -RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation Write-Host -ForegroundColor Green 'standard web test created successfully.' + #Variables for application insights test + $env.component1 = "component" + (RandomString -allChars $false -len 6) + # For any resources you created for test, you should add it to $env here. $envFile = 'env.json' if ($TestMode -eq 'live') { @@ -71,5 +74,4 @@ function setupEnv() { function cleanupEnv() { # Clean resources you create for testing Remove-AzResourceGroup -Name $env.resourceGroup -} - +} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ApplicationInsights.Test.csproj b/src/ApplicationInsights/ApplicationInsights.Test/ApplicationInsights.Test.csproj deleted file mode 100644 index bf537fc63efa..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ApplicationInsights.Test.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - ApplicationInsights - - - - - - $(LegacyAssemblyPrefix)$(PsModuleName)$(AzTestAssemblySuffix) - - - - - - - - \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApiKeyTests.cs b/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApiKeyTests.cs deleted file mode 100644 index ac7967ee31f8..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApiKeyTests.cs +++ /dev/null @@ -1,55 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - - -using Microsoft.Azure.ServiceManagement.Common.Models; -using Microsoft.WindowsAzure.Commands.ScenarioTest; -using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests -{ - public class ApiKeyTests : RMTestBase - { - public XunitTracingInterceptor _logger; - - public ApiKeyTests(Xunit.Abstractions.ITestOutputHelper output) - { - _logger = new XunitTracingInterceptor(output); - XunitTracingInterceptor.AddToContext(_logger); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestGetAppInsightsApiKey() - { - TestController.NewInstance.RunPsTest(_logger, "Test-GetApplicationInsightsApiKey"); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestNewAppInsightsApiKey() - { - TestController.NewInstance.RunPsTest(_logger, "Test-NewApplicationInsightsApiKey"); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestRemoveAppInsightsApiKey() - { - TestController.NewInstance.RunPsTest(_logger, "Test-RemoveApplicationInsightsApiKey"); - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApiKeyTests.ps1 b/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApiKeyTests.ps1 deleted file mode 100644 index cc749d3e89ff..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApiKeyTests.ps1 +++ /dev/null @@ -1,149 +0,0 @@ -# ---------------------------------------------------------------------------------- -# -# Copyright Microsoft Corporation -# 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. -# ---------------------------------------------------------------------------------- - -<# -.SYNOPSIS -Test Get-AzApplicationInsightsApiKey -#> -function Test-GetApplicationInsightsApiKey -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $apiKeyName = "test"; - $permissions = @("ReadTelemetry", "WriteAnnotations", "AuthenticateSDKControlChannel"); - $apiKey = New-AzApplicationInsightsApiKey -ResourceGroupName $rgname -Name $appName -Description $apiKeyName -Permissions $permissions; - - $apiKey2 = Get-AzApplicationInsightsApiKey -ResourceGroupName $rgname -Name $appName -ApiKeyId $apiKey.Id; - - Assert-AreEqual $apiKeyName $apiKey2.Description - Assert-NotNull $apiKey2.Id - #we only return apikey once when it created, when doing get, it does not return back anymore. - Assert-Null $apiKey2.ApiKey - Assert-AreEqual 3 $apiKey2.Permissions.count - - $apiKeys = Get-AzApplicationInsightsApiKey -ResourceGroupName $rgname -Name $appName; - - Assert-AreEqual 1 $apiKeys.count - Assert-AreEqual $apiKeyName $apiKeys[0].Description - Assert-NotNull $apiKeys[0].Id - #we only return apikey once when it created, when doing get, it does not return back anymore. - Assert-Null $apiKeys[0].ApiKey - Assert-AreEqual 3 $apiKeys[0].Permissions.count - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - -<# -.SYNOPSIS -Test New-AzApplicationInsightsApiKey -#> -function Test-NewApplicationInsightsApiKey -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $apiKeyName = "test"; - $permissions = @("ReadTelemetry", "WriteAnnotations", "AuthenticateSDKControlChannel"); - $apiKey = New-AzApplicationInsightsApiKey -ResourceGroupName $rgname -Name $appName -Description $apiKeyName -Permissions $permissions; - - Assert-AreEqual $apiKeyName $apiKey.Description - Assert-NotNull $apiKey.Id - Assert-NotNull $apiKey.ApiKey - Assert-AreEqual 3 $apiKey.Permissions.count - - $apiKey2 = Get-AzApplicationInsightsApiKey -ResourceGroupName $rgname -Name $appName -ApiKeyId $apiKey.Id; - - Assert-AreEqual $apiKeyName $apiKey2.Description - Assert-NotNull $apiKey2.Id - #we only return apikey once when it created, when doing get, it does not return back anymore. - Assert-Null $apiKey2.ApiKey - Assert-AreEqual 3 $apiKey2.Permissions.count - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - - -<# -.SYNOPSIS -Test Remove-AzApplicationInsightsApiKey -#> -function Test-RemoveApplicationInsightsApiKey -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $apiKeyName = "test"; - $permissions = @("ReadTelemetry", "WriteAnnotations", "AuthenticateSDKControlChannel"); - $apiKey = New-AzApplicationInsightsApiKey -ResourceGroupName $rgname -Name $appName -Description $apiKeyName -Permissions $permissions; - - Assert-AreEqual $apiKeyName $apiKey.Description - Assert-NotNull $apiKey.Id - Assert-NotNull $apiKey.ApiKey - Assert-AreEqual 3 $apiKey.Permissions.count - - $apiKey2 = Get-AzApplicationInsightsApiKey -ResourceGroupName $rgname -Name $appName -ApiKeyId $apiKey.Id; - - Assert-NotNull $apiKey2 - - Remove-AzApplicationInsightsApiKey -ResourceGroupName $rgname -Name $appName -ApiKeyId $apiKey.Id; - - #Assert-ThrowsContains { Get-AzApplicationInsightsApiKey -ResourceGroupName $rgname -Name $appName -ApiKeyId $apiKey.Id } "NotFound" - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApplicationInsightsTests.cs b/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApplicationInsightsTests.cs deleted file mode 100644 index bf12619ef65e..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApplicationInsightsTests.cs +++ /dev/null @@ -1,41 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - - -using Microsoft.Azure.ServiceManagement.Common.Models; -using Microsoft.WindowsAzure.Commands.ScenarioTest; -using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests -{ - public class ApplicationInsightsTests : RMTestBase - { - public XunitTracingInterceptor _logger; - - public ApplicationInsightsTests(Xunit.Abstractions.ITestOutputHelper output) - { - _logger = new XunitTracingInterceptor(output); - XunitTracingInterceptor.AddToContext(_logger); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestAppInsightsCRUD() - { - TestController.NewInstance.RunPsTest(_logger, "Test-ApplicationInsightsCRUD"); - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApplicationInsightsTests.ps1 b/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApplicationInsightsTests.ps1 deleted file mode 100644 index 8d672f943c02..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ApplicationInsightsTests.ps1 +++ /dev/null @@ -1,183 +0,0 @@ -# ---------------------------------------------------------------------------------- -# -# Copyright Microsoft Corporation -# 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. -# ---------------------------------------------------------------------------------- - -<# -.SYNOPSIS -Test ApplicationInsightsCRUD -#> -function Test-ApplicationInsightsCRUD -{ - # setup - $rgname = "azps-test-group-mock" - $appName = "azps-test-ai-mock"; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - $key = "key" - $val = "val" - $tag = @{$key=$val} - - try - { - # Test - - New-AzResourceGroup -Name $rgname -Location $loc; - - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind - - $app = Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName - - Assert-AreEqual $app.Name $appName - Assert-AreEqual $app.Kind $kind - Assert-NotNull $app.InstrumentationKey - Assert-AreEqual "Enabled" $app.PublicNetworkAccessForIngestion - Assert-AreEqual "Enabled" $app.PublicNetworkAccessForQuery - - $apps = Get-AzApplicationInsights -ResourceGroupName $rgname; - - Assert-AreEqual $apps.count 1 - Assert-AreEqual $apps[0].Name $appName - Assert-AreEqual $apps[0].Kind $kind - Assert-NotNull $apps[0].InstrumentationKey - Assert-NotNull $app[0].ConnectionString - - $app = Update-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Tags $tag -PublicNetworkAccessForIngestion "Disabled" -PublicNetworkAccessForQuery "Disabled" - - Assert-AreEqual "Disabled" $app.PublicNetworkAccessForIngestion - Assert-AreEqual "Disabled" $app.PublicNetworkAccessForQuery - Assert-AreEqual $val $app.Tags[$key] - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - - Remove-AzResourceGroup -Name $rgname - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - -<# -.SYNOPSIS -Test Get-AzApplicationInsights -#> -function Test-GetApplicationInsights -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - - $app = New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind - - Assert-AreEqual $app.Name $appName - Assert-AreEqual $app.Kind $kind - Assert-NotNull $app.InstrumentationKey - - $apps = Get-AzApplicationInsights -ResourceGroupName $rgname; - - Assert-AreEqual $apps.count 1 - Assert-AreEqual $apps[0].Name $appName - Assert-AreEqual $apps[0].Kind $kind - Assert-NotNull $apps[0].InstrumentationKey - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - -<# -.SYNOPSIS -Test New-AzApplicationInsights -#> -function Test-NewApplicationInsights -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - - $app = New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind - - Assert-AreEqual $app.Name $appName - Assert-AreEqual $app.Kind $kind - Assert-NotNull $app.InstrumentationKey - - $app = Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - - Assert-AreEqual $app.Name $appName - Assert-AreEqual $app.Kind $kind - Assert-NotNull $app.InstrumentationKey - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - -<# -.SYNOPSIS -Test Remove-AzApplicationInsights -#> -function Test-RemoveApplicationInsights -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind - - $app = Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - - Assert-NotNull $app - Assert-AreEqual $app.Name $appName - Assert-AreEqual $app.Kind $kind - Assert-NotNull $app.InstrumentationKey - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - - Assert-ThrowsContains { Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName } "not found" - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/Common.ps1 b/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/Common.ps1 deleted file mode 100644 index 771c8b68fac2..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/Common.ps1 +++ /dev/null @@ -1,159 +0,0 @@ -# ---------------------------------------------------------------------------------- -# -# Copyright Microsoft Corporation -# 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. -# ---------------------------------------------------------------------------------- - -<# -.SYNOPSIS -Cleans the created resource groups -#> -function Clean-ResourceGroup($rgname) -{ - if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { - Remove-AzResourceGroup -Name $rgname -Force - } -} - -###################### -# -# Retry the given code block until it succeeds or times out. -# -# param [ScriptBlock] $script : The code to test -# param [int] $times : The times of running the code -# param [string] $message : The text of the exception that should be thrown -####################### -function Retry-IfException -{ - param([ScriptBlock] $script, [int] $times = 30, [string] $message = "*") - - if ($times -le 0) - { - throw 'Retry time(s) should not be equal to or less than 0.'; - } - - $oldErrorActionPreferenceValue = $ErrorActionPreference; - $ErrorActionPreference = "SilentlyContinue"; - - $iter = 0; - $succeeded = $false; - while (($iter -lt $times) -and (-not $succeeded)) - { - $iter += 1; - - try - { - &$script; - } - catch - { - - } - - if ($Error.Count -gt 0) - { - $actualMessage = $Error[0].Exception.Message; - - Write-Output ("Caught exception: '$actualMessage'"); - - if (-not ($actualMessage -like $message)) - { - $ErrorActionPreference = $oldErrorActionPreferenceValue; - throw "Expected exception not received: '$message' the actual message is '$actualMessage'"; - } - - $Error.Clear(); - Wait-Seconds 10; - continue; - } - - $succeeded = $true; - } - - $ErrorActionPreference = $oldErrorActionPreferenceValue; -} - -<# -.SYNOPSIS -Gets random resource name -#> -function Get-RandomItemName -{ - param([string] $prefix = "pslibtest") - - if ($prefix -eq $null -or $prefix -eq '') - { - $prefix = "pslibtest"; - } - - $str = $prefix + ((Get-Random) % 10000); - return $str; -} - -<# -.SYNOPSIS -Gets valid resource name for compute test -#> -function Get-ApplicationInsightsTestResourceName -{ - $stack = Get-PSCallStack - $testName = $null; - foreach ($frame in $stack) - { - if ($frame.Command.StartsWith("Test-", "CurrentCultureIgnoreCase")) - { - $testName = $frame.Command; - } - } - - $oldErrorActionPreferenceValue = $ErrorActionPreference; - $ErrorActionPreference = "SilentlyContinue"; - - try - { - $assetName = [Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::GetAssetName($testName, "pstestrg"); - } - catch - { - if (($Error.Count -gt 0) -and ($Error[0].Exception.Message -like '*Unable to find type*')) - { - $assetName = Get-RandomItemName; - } - else - { - throw; - } - } - finally - { - $ErrorActionPreference = $oldErrorActionPreferenceValue; - } - - return $assetName -} - -<# -.SYNOPSIS -Gets the default location for a provider -#> -function Get-ProviderLocation($provider) -{ - "eastus" -} - -<# -.SYNOPSIS -Gets the Canary location for a provider -#> -function Get-ProviderLocation_Canary($provider) -{ - "eastus2euap" -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ContinuousExportTests.cs b/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ContinuousExportTests.cs deleted file mode 100644 index 7389f0195a7a..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ContinuousExportTests.cs +++ /dev/null @@ -1,62 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - - -using Microsoft.Azure.ServiceManagement.Common.Models; -using Microsoft.WindowsAzure.Commands.ScenarioTest; -using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests -{ - public class ContinuousExportTests : RMTestBase - { - public XunitTracingInterceptor _logger; - - public ContinuousExportTests(Xunit.Abstractions.ITestOutputHelper output) - { - _logger = new XunitTracingInterceptor(output); - XunitTracingInterceptor.AddToContext(_logger); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestGetContinuousExport() - { - TestController.NewInstance.RunPsTest(_logger, "Test-GetApplicationInsightsContinuousExport"); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestNewContinuousExport() - { - TestController.NewInstance.RunPsTest(_logger, "Test-NewApplicationInsightsContinuousExport"); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestSetContinuousExport() - { - TestController.NewInstance.RunPsTest(_logger, "Test-SetApplicationInsightsContinuousExport"); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestRemoveContinuousExport() - { - TestController.NewInstance.RunPsTest(_logger, "Test-RemoveApplicationInsightsContinuousExport"); - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ContinuousExportTests.ps1 b/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ContinuousExportTests.ps1 deleted file mode 100644 index d98b68eb31fd..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/ContinuousExportTests.ps1 +++ /dev/null @@ -1,223 +0,0 @@ -# ---------------------------------------------------------------------------------- -# -# Copyright Microsoft Corporation -# 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. -# ---------------------------------------------------------------------------------- - -<# -.SYNOPSIS -Test Get-AzApplicationInsightsContinuousExport -#> -function Test-GetApplicationInsightsContinuousExport -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $dummySubId = "50359d91-7b9d-4823-85af-eb298a61ba97"; - $dummyStorageAccount = "dummysa"; - $dummyContainer = "dummycontianer"; - - $destinatinStorageAccountId = "/subscriptions/" + $dummySubId + "/resourceGroups/" + $rgname + "/providers/Microsoft.Storage/storageAccounts/"+ $dummyStorageAccount; - $destinationStorageAccountSASToken = "https://"+ $dummyStorageAccount + ".blob.core.windows.net/"+$dummyContainer + "?sv=2015-04-05&sr=c&sig=xxxxxxxxx&sp=w"; - - $documentTypes = @("Request", "Custom Event"); - $continuousExport = New-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName -DocumentType $documentTypes -StorageAccountId $destinatinStorageAccountId -StorageLocation $loc -StorageSASUri $destinationStorageAccountSASToken; - - $continuousExport2 = Get-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName -ExportId $continuousExport.ExportId; - - Assert-NotNull $continuousExport2 - Assert-AreEqual "Request, Custom Event" $continuousExport2.DocumentTypes - Assert-AreEqual $dummySubId $continuousExport2.DestinationStorageSubscriptionId - Assert-AreEqual $loc $continuousExport2.DestinationStorageLocationId - Assert-AreEqual $dummyContainer $continuousExport2.ContainerName - - $continuousExports = Get-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName; - - Assert-AreEqual 1 $continuousExports.count - Assert-AreEqual "Request, Custom Event" $continuousExports[0].DocumentTypes - Assert-AreEqual $dummySubId $continuousExports[0].DestinationStorageSubscriptionId - Assert-AreEqual $loc $continuousExports[0].DestinationStorageLocationId - Assert-AreEqual $dummyContainer $continuousExports[0].ContainerName - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - -<# -.SYNOPSIS -Test New-AzApplicationInsightsContinuousExport -#> -function Test-NewApplicationInsightsContinuousExport -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $dummySubId = "50359d91-7b9d-4823-85af-eb298a61ba97"; - $dummyStorageAccount = "dummysa"; - $dummyContainer = "dummycontianer"; - - $destinatinStorageAccountId = "/subscriptions/" + $dummySubId + "/resourceGroups/" + $rgname + "/providers/Microsoft.Storage/storageAccounts/"+ $dummyStorageAccount; - $destinationStorageAccountSASToken = "https://"+ $dummyStorageAccount + ".blob.core.windows.net/"+$dummyContainer + "?sv=2015-04-05&sr=c&sig=xxxxxxxxx&sp=w"; - - $documentTypes = @("Request", "Custom Event"); - $continuousExport = New-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName -DocumentType $documentTypes -StorageAccountId $destinatinStorageAccountId -StorageLocation $loc -StorageSASUri $destinationStorageAccountSASToken; - - Assert-NotNull $continuousExport - Assert-AreEqual "Request, Custom Event" $continuousExport.DocumentTypes - Assert-AreEqual $dummySubId $continuousExport.DestinationStorageSubscriptionId - Assert-AreEqual $loc $continuousExport.DestinationStorageLocationId - Assert-AreEqual $dummyContainer $continuousExport.ContainerName - - $continuousExport2 = Get-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName -ExportId $continuousExport.ExportId; - - Assert-NotNull $continuousExport2 - Assert-AreEqual "Request, Custom Event" $continuousExport2.DocumentTypes - Assert-AreEqual $dummySubId $continuousExport2.DestinationStorageSubscriptionId - Assert-AreEqual $loc $continuousExport2.DestinationStorageLocationId - Assert-AreEqual $dummyContainer $continuousExport2.ContainerName - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - - -<# -.SYNOPSIS -Test Remove-AzApplicationInsightsContinuousExport -#> -function Test-RemoveApplicationInsightsContinuousExport -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $dummySubId = "50359d91-7b9d-4823-85af-eb298a61ba97"; - $dummyStorageAccount = "dummysa"; - $dummyContainer = "dummycontianer"; - - $destinatinStorageAccountId = "/subscriptions/" + $dummySubId + "/resourceGroups/" + $rgname + "/providers/Microsoft.Storage/storageAccounts/"+ $dummyStorageAccount; - $destinationStorageAccountSASToken = "https://"+ $dummyStorageAccount + ".blob.core.windows.net/"+$dummyContainer + "?sv=2015-04-05&sr=c&sig=xxxxxxxxx&sp=w"; - - $documentTypes = @("Request", "Custom Event"); - $continuousExport = New-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName -DocumentType $documentTypes -StorageAccountId $destinatinStorageAccountId -StorageLocation $loc -StorageSASUri $destinationStorageAccountSASToken; - - $continuousExport2 = Get-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName -ExportId $continuousExport.ExportId; - - Assert-NotNull $continuousExport2 - Assert-AreEqual "Request, Custom Event" $continuousExport2.DocumentTypes - Assert-AreEqual $dummySubId $continuousExport2.DestinationStorageSubscriptionId - Assert-AreEqual $loc $continuousExport2.DestinationStorageLocationId - Assert-AreEqual $dummyContainer $continuousExport2.ContainerName - - Remove-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName -ExportId $continuousExport.ExportId; - - $continuousExports = Get-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName; - Assert-AreEqual 0 $continuousExports.count; - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - -<# -.SYNOPSIS -Test Set-AzApplicationInsightsContinuousExport -#> -function Test-SetApplicationInsightsContinuousExport -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $dummySubId = "50359d91-7b9d-4823-85af-eb298a61ba97"; - $dummyStorageAccount = "dummysa"; - $dummyContainer = "dummycontianer"; - - $destinatinStorageAccountId = "/subscriptions/" + $dummySubId + "/resourceGroups/" + $rgname + "/providers/Microsoft.Storage/storageAccounts/"+ $dummyStorageAccount; - $destinationStorageAccountSASToken = "https://"+ $dummyStorageAccount + ".blob.core.windows.net/"+$dummyContainer + "?sv=2015-04-05&sr=c&sig=xxxxxxxxx&sp=w"; - - $documentTypes = @("Request", "Custom Event"); - $continuousExport = New-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName -DocumentType $documentTypes -StorageAccountId $destinatinStorageAccountId -StorageLocation $loc -StorageSASUri $destinationStorageAccountSASToken; - - $continuousExport2 = Get-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName -ExportId $continuousExport.ExportId; - - Assert-NotNull $continuousExport2 - Assert-AreEqual "Request, Custom Event" $continuousExport2.DocumentTypes - Assert-AreEqual $dummySubId $continuousExport2.DestinationStorageSubscriptionId - Assert-AreEqual $loc $continuousExport2.DestinationStorageLocationId - Assert-AreEqual $dummyContainer $continuousExport2.ContainerName - - $documentTypes = @("Request", "Custom Event", "Exception"); - $continuousExport3 = Set-AzApplicationInsightsContinuousExport -ResourceGroupName $rgname -Name $appName -ExportId $continuousExport.ExportId -DocumentType $documentTypes -StorageAccountId $destinatinStorageAccountId -StorageLocation $loc -StorageSASUri $destinationStorageAccountSASToken; - Assert-NotNull $continuousExport3 - Assert-AreEqual "Request, Custom Event, Exception" $continuousExport3.DocumentTypes - Assert-AreEqual $dummySubId $continuousExport3.DestinationStorageSubscriptionId - Assert-AreEqual $loc $continuousExport3.DestinationStorageLocationId - Assert-AreEqual $dummyContainer $continuousExport3.ContainerName - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - - diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/LinkedStorageAccountTests.cs b/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/LinkedStorageAccountTests.cs deleted file mode 100644 index ef19442ee992..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/LinkedStorageAccountTests.cs +++ /dev/null @@ -1,41 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - - -using Microsoft.Azure.ServiceManagement.Common.Models; -using Microsoft.WindowsAzure.Commands.ScenarioTest; -using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests -{ - public class LinkedStorageAccountTests : RMTestBase - { - public XunitTracingInterceptor _logger; - - public LinkedStorageAccountTests(Xunit.Abstractions.ITestOutputHelper output) - { - _logger = new XunitTracingInterceptor(output); - XunitTracingInterceptor.AddToContext(_logger); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestLinkedStorageAccountCRUD() - { - TestController.NewInstance.RunPsTest(_logger, "Test-LinkedStorageAccountCRUD"); - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/LinkedStorageAccountTests.ps1 b/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/LinkedStorageAccountTests.ps1 deleted file mode 100644 index 99016c14514b..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/LinkedStorageAccountTests.ps1 +++ /dev/null @@ -1,82 +0,0 @@ -# ---------------------------------------------------------------------------------- -# -# Copyright Microsoft Corporation -# 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. -# ---------------------------------------------------------------------------------- - -<# -.SYNOPSIS -Test LinkedStorageAccountCRUD -#> -function Test-LinkedStorageAccountCRUD -{ - # setup - $rgname = "azps-test-group-mock" - $appName = "azps-test-ai-mock"; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - - $accountName1 = "azpstestaccountamock" - $accountName2 = "azpstestaccountbmock" - - try - { - New-AzResourceGroup -Name $rgname -Location $loc; - - $app = New-AzApplicationInsights -ResourceGroupName $rgname -ComponentName $appName -Location $loc -Kind $kind - - $account1 = New-AzStorageAccount -ResourceGroupName $rgname -Name $accountName1 -SkuName "Standard_LRS" -Location $loc - $account2 = New-AzStorageAccount -ResourceGroupName $rgname -Name $accountName2 -SkuName "Standard_LRS" -Location $loc - - New-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName $rgname -ComponentName $appName -LinkedStorageAccountResourceId $account1.Id - $linkedAccount = Get-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName $rgname -ComponentName $appName - - Assert-NotNull $linkedAccount - Assert-AreEqual $account1.Id $linkedAccount.linkedStorageAccount - Assert-AreEqual "serviceprofiler" $linkedAccount.Name - - Update-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName $rgname -ComponentName $appName -LinkedStorageAccountResourceId $account2.Id - $linkedAccount = Get-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName $rgname -ComponentName $appName - - Assert-NotNull $linkedAccount - Assert-AreEqual $account2.Id $linkedAccount.linkedStorageAccount - - Remove-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName $rgname -ComponentName $appName - - # Test CRUD by pipeline. - New-AzApplicationInsightsLinkedStorageAccount -InputObject $app -LinkedStorageAccountResourceId $account1.Id - $linkedAccount = Get-AzApplicationInsightsLinkedStorageAccount -InputObject $app - - Assert-NotNull $linkedAccount - Assert-AreEqual $account1.Id $linkedAccount.linkedStorageAccount - Assert-AreEqual "serviceprofiler" $linkedAccount.Name - - Update-AzApplicationInsightsLinkedStorageAccount -InputObject $app -LinkedStorageAccountResourceId $account2.Id - $linkedAccount = Get-AzApplicationInsightsLinkedStorageAccount -InputObject $app - - Assert-NotNull $linkedAccount - Assert-AreEqual $account2.Id $linkedAccount.linkedStorageAccount - - Remove-AzApplicationInsightsLinkedStorageAccount -InputObject $app - - Remove-AzStorageAccount -ResourceGroupName $rgname -Name $accountName1 -force - Remove-AzStorageAccount -ResourceGroupName $rgname -Name $accountName2 -force - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName - - Remove-AzResourceGroup -Name $rgname - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/PricingAndDailyCapTests.cs b/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/PricingAndDailyCapTests.cs deleted file mode 100644 index 5e5b91ec7a08..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/PricingAndDailyCapTests.cs +++ /dev/null @@ -1,69 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - - -using Microsoft.Azure.ServiceManagement.Common.Models; -using Microsoft.WindowsAzure.Commands.ScenarioTest; -using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests -{ - public class PricingAndDailyCapTests : RMTestBase - { - public XunitTracingInterceptor _logger; - - public PricingAndDailyCapTests(Xunit.Abstractions.ITestOutputHelper output) - { - _logger = new XunitTracingInterceptor(output); - XunitTracingInterceptor.AddToContext(_logger); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestGetPricingPlan() - { - TestController.NewInstance.RunPsTest(_logger, "Test-GetApplicationInsightsPricingPlan"); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestSetPricingPlan() - { - TestController.NewInstance.RunPsTest(_logger, "Test-SetApplicationInsightsPricingPlan"); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestGetAppInsightsDailyCap() - { - TestController.NewInstance.RunPsTest(_logger, "Test-GetApplicationInsightsDailyCap"); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestSetAppInsightsDailyCap() - { - TestController.NewInstance.RunPsTest(_logger, "Test-SetApplicationInsightsDailyCap"); - } - - [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] - public void TestGetDailyCapStatus() - { - TestController.NewInstance.RunPsTest(_logger, "Test-GetApplicationInsightsDailyCapStatus"); - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/PricingAndDailyCapTests.ps1 b/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/PricingAndDailyCapTests.ps1 deleted file mode 100644 index 20a6b32876af..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/ScenarioTests/PricingAndDailyCapTests.ps1 +++ /dev/null @@ -1,191 +0,0 @@ -# ---------------------------------------------------------------------------------- -# -# Copyright Microsoft Corporation -# 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. -# ---------------------------------------------------------------------------------- - -<# -.SYNOPSIS -Test Get-AzApplicationInsightsPricingPlan -#> -function Test-GetApplicationInsightsPricingPlan -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $pricingPlan = Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -IncludePricingPlan; - - Assert-NotNull $pricingPlan - Assert-AreEqual "Basic" $pricingPlan.PricingPlan - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - - -<# -.SYNOPSIS -Test Set-AzApplicationInsightsPricingPlan -#> -function Test-SetApplicationInsightsPricingPlan -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $pricingPlan = Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -IncludePricingPlan; - - Assert-NotNull $pricingPlan - Assert-AreEqual "Basic" $pricingPlan.PricingPlan - - $planName = "Application Insights Enterprise"; - $dailyCapGB = 300; - $stopSendEmail = $True; - Set-AzApplicationInsightsPricingPlan -ResourceGroupName $rgname -Name $appName -PricingPlan $planName -DailyCapGB $dailyCapGB -DisableNotificationWhenHitCap; - - $pricingPlan2 = Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -IncludePricingPlan; - Assert-NotNull $pricingPlan2 - #Assert-AreEqual $planName $pricingPlan2.PricingPlan - Assert-AreEqual $dailyCapGB $pricingPlan2.Cap - Assert-AreEqual $stopSendEmail $pricingPlan2.StopSendNotificationWhenHitCap - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - -<# -.SYNOPSIS -Test Get-AzApplicationInsightsDailyCap -#> -function Test-GetApplicationInsightsDailyCap -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $dailyCap = Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -IncludePricingPlan; - - Assert-NotNull $dailyCap - Assert-AreEqual 100 $dailyCap.Cap - Assert-AreEqual $False $dailyCap.StopSendNotificationWhenHitCap - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - - -<# -.SYNOPSIS -Test Set-AzApplicationInsightsDailyCap -#> -function Test-SetApplicationInsightsDailyCap -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $dailyCapGB = 300; - $stopSendEmail = $True; - Set-AzApplicationInsightsDailyCap -ResourceGroupName $rgname -Name $appName -DailyCapGB $dailyCapGB -DisableNotificationWhenHitCap; - - $dailyCapInfo = Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -IncludePricingPlan; - Assert-NotNull $dailyCapInfo - Assert-AreEqual $dailyCapGB $dailyCapInfo.Cap - Assert-AreEqual $stopSendEmail $dailyCapInfo.StopSendNotificationWhenHitCap - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} - -<# -.SYNOPSIS -Test Get-AzApplicationInsightsDailyCapStatus -#> -function Test-GetApplicationInsightsDailyCapStatus -{ - # Setup - $rgname = Get-ApplicationInsightsTestResourceName; - - try - { - # Test - $appName = "app" + $rgname; - $loc = Get-ProviderLocation ResourceManagement; - $kind = "web"; - New-AzResourceGroup -Name $rgname -Location $loc; - New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind; - - $dailyCapStatus = Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -IncludeDailyCapStatus; - - Assert-NotNull $dailyCapStatus - Assert-AreEqual $False $dailyCapStatus.IsCapped - - Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; - } - finally - { - # Cleanup - Clean-ResourceGroup $rgname - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApiKeyTests/TestGetAppInsightsApiKey.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApiKeyTests/TestGetAppInsightsApiKey.json deleted file mode 100644 index 67ebf604d889..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApiKeyTests/TestGetAppInsightsApiKey.json +++ /dev/null @@ -1,777 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg636?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnNjM2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "0d7dd5c5-d583-4c06-9544-c2bf25371ea9" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-request-id": [ - "0c158b82-fb0a-47c6-9892-3634b306cda2" - ], - "x-ms-correlation-request-id": [ - "0c158b82-fb0a-47c6-9892-3634b306cda2" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104844Z:0c158b82-fb0a-47c6-9892-3634b306cda2" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:48:43 GMT" - ], - "Content-Length": [ - "175" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636\",\r\n \"name\": \"pstestrg636\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/Microsoft.Insights/components/apppstestrg636?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjM2L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzYzNj9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "2ef1b010-9adb-45d9-8bf8-ab93d4d4671e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "b5b49787-4ade-4e8c-97fa-96c384063545" - ], - "x-ms-correlation-request-id": [ - "b5b49787-4ade-4e8c-97fa-96c384063545" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104845Z:b5b49787-4ade-4e8c-97fa-96c384063545" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:48:45 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "159" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg636' under resource group 'pstestrg636' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/Microsoft.Insights/components/apppstestrg636?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjM2L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzYzNj9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "f0904016-2d7c-4080-b8ba-e07d44d67c03" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "f0904016-2d7c-4080-b8ba-e07d44d67c03" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "ecc13e14-de3c-469a-826c-993d61249d08" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104855Z:ecc13e14-de3c-469a-826c-993d61249d08" - ], - "Date": [ - "Fri, 01 May 2020 10:48:55 GMT" - ], - "Content-Length": [ - "885" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636\",\r\n \"name\": \"apppstestrg636\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"07006a61-0000-0100-0000-5eabfe950000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg636\",\r\n \"AppId\": \"24fc17a5-1a09-42bc-91e1-cc95968ed285\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"348cf5cf-2c6d-422a-8372-f00f9aece90b\",\r\n \"ConnectionString\": \"InstrumentationKey=348cf5cf-2c6d-422a-8372-f00f9aece90b\",\r\n \"Name\": \"apppstestrg636\",\r\n \"CreationDate\": \"2020-05-01T18:48:53.0584895+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/Microsoft.Insights/components/apppstestrg636/ApiKeys?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjM2L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzYzNi9BcGlLZXlzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"name\": \"test\",\r\n \"linkedReadProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/api\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/agentconfig\"\r\n ],\r\n \"linkedWriteProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/annotations\"\r\n ]\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "c6e675ee-fc34-4f3c-84c7-a343c8ed20cc" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "545" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "c6e675ee-fc34-4f3c-84c7-a343c8ed20cc" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "ef7ae6f9-be94-4b61-92ba-ea34daa924c5" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104856Z:ef7ae6f9-be94-4b61-92ba-ea34daa924c5" - ], - "Date": [ - "Fri, 01 May 2020 10:48:56 GMT" - ], - "Content-Length": [ - "836" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/apikeys/48c809ab-141a-4fb1-a952-5d3ff3da00ad\",\r\n \"name\": \"test\",\r\n \"linkedReadProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/api\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/agentconfig\"\r\n ],\r\n \"linkedWriteProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/annotations\"\r\n ],\r\n \"apiKey\": \"cfz33na4rcuncldwi7kqyqrrsdo5nbvrfe4zc0ru\",\r\n \"createdDate\": \"Fri, 01 May 2020 10:48:56 GMT\",\r\n \"integrationType\": null,\r\n \"integrationProperty\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/Microsoft.Insights/components/apppstestrg636/APIKeys/48c809ab-141a-4fb1-a952-5d3ff3da00ad?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjM2L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzYzNi9BUElLZXlzLzQ4YzgwOWFiLTE0MWEtNGZiMS1hOTUyLTVkM2ZmM2RhMDBhZD9hcGktdmVyc2lvbj0yMDE1LTA1LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "37d3acf8-302a-4d92-bc13-1ff3bb2a7436" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "37d3acf8-302a-4d92-bc13-1ff3bb2a7436" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11991" - ], - "x-ms-correlation-request-id": [ - "6762157f-f8d5-40f2-8d62-1c0fec7a6e58" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104857Z:6762157f-f8d5-40f2-8d62-1c0fec7a6e58" - ], - "Date": [ - "Fri, 01 May 2020 10:48:56 GMT" - ], - "Content-Length": [ - "1365" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/apikeys/48c809ab-141a-4fb1-a952-5d3ff3da00ad\",\r\n \"name\": \"test\",\r\n \"linkedReadProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/api\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/draft\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/extendqueries\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/search\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/aggregate\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/agentconfig\"\r\n ],\r\n \"linkedWriteProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/annotations\"\r\n ],\r\n \"createdDate\": \"Fri, 01 May 2020 10:48:56 GMT\",\r\n \"integrationType\": null,\r\n \"integrationProperty\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/Microsoft.Insights/components/apppstestrg636/ApiKeys?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjM2L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzYzNi9BcGlLZXlzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "323400c1-e396-4d53-92e9-84c8af294cf9" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "323400c1-e396-4d53-92e9-84c8af294cf9" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11990" - ], - "x-ms-correlation-request-id": [ - "9de062f2-6fef-4784-b7fd-8b567cdf7b51" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104857Z:9de062f2-6fef-4784-b7fd-8b567cdf7b51" - ], - "Date": [ - "Fri, 01 May 2020 10:48:57 GMT" - ], - "Content-Length": [ - "1377" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/apikeys/48c809ab-141a-4fb1-a952-5d3ff3da00ad\",\r\n \"name\": \"test\",\r\n \"linkedReadProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/api\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/draft\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/extendqueries\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/search\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/aggregate\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/agentconfig\"\r\n ],\r\n \"linkedWriteProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/microsoft.insights/components/apppstestrg636/annotations\"\r\n ],\r\n \"createdDate\": \"Fri, 01 May 2020 10:48:56 GMT\",\r\n \"integrationType\": null,\r\n \"integrationProperty\": null\r\n }\r\n ]\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg636/providers/Microsoft.Insights/components/apppstestrg636?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjM2L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzYzNj9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "447cf65f-2949-444d-87a7-b9e95880ebb5" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "447cf65f-2949-444d-87a7-b9e95880ebb5" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-correlation-request-id": [ - "e720098c-203d-4ac7-ae26-5222efb61b7b" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104902Z:e720098c-203d-4ac7-ae26-5222efb61b7b" - ], - "Date": [ - "Fri, 01 May 2020 10:49:01 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg636?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnNjM2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "9b2d7165-439d-466f-9cf2-c6cd8fac90df" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzNi1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-request-id": [ - "ac5cd923-08a1-45a0-b8c0-e3556d4a0752" - ], - "x-ms-correlation-request-id": [ - "ac5cd923-08a1-45a0-b8c0-e3556d4a0752" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104906Z:ac5cd923-08a1-45a0-b8c0-e3556d4a0752" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:49:06 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzNi1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSell6TmkxRlFWTlVWVk1pTENKcWIySk1iMk5oZEdsdmJpSTZJbVZoYzNSMWN5Sjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzNi1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" - ], - "x-ms-request-id": [ - "72141463-a876-49cc-a341-bc2b449b0279" - ], - "x-ms-correlation-request-id": [ - "72141463-a876-49cc-a341-bc2b449b0279" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104921Z:72141463-a876-49cc-a341-bc2b449b0279" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:49:21 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzNi1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSell6TmkxRlFWTlVWVk1pTENKcWIySk1iMk5oZEdsdmJpSTZJbVZoYzNSMWN5Sjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzNi1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-request-id": [ - "9e70a01f-078f-4aeb-8291-13783a9e05bd" - ], - "x-ms-correlation-request-id": [ - "9e70a01f-078f-4aeb-8291-13783a9e05bd" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104937Z:9e70a01f-078f-4aeb-8291-13783a9e05bd" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:49:36 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzNi1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSell6TmkxRlFWTlVWVk1pTENKcWIySk1iMk5oZEdsdmJpSTZJbVZoYzNSMWN5Sjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-request-id": [ - "731b6f28-0b03-4095-a1fa-c83dd8e8e0e0" - ], - "x-ms-correlation-request-id": [ - "731b6f28-0b03-4095-a1fa-c83dd8e8e0e0" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104952Z:731b6f28-0b03-4095-a1fa-c83dd8e8e0e0" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:49:52 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzNi1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSell6TmkxRlFWTlVWVk1pTENKcWIySk1iMk5oZEdsdmJpSTZJbVZoYzNSMWN5Sjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-request-id": [ - "f0035856-3b35-4d56-9fa2-f4738c177915" - ], - "x-ms-correlation-request-id": [ - "f0035856-3b35-4d56-9fa2-f4738c177915" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104953Z:f0035856-3b35-4d56-9fa2-f4738c177915" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:49:53 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-GetApplicationInsightsApiKey": [ - "pstestrg636" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApiKeyTests/TestNewAppInsightsApiKey.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApiKeyTests/TestNewAppInsightsApiKey.json deleted file mode 100644 index 3c6a8c63b1a7..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApiKeyTests/TestNewAppInsightsApiKey.json +++ /dev/null @@ -1,708 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg7541?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnNzU0MT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "a0cac6e0-4ef4-4c43-bf19-324ada6f7d1b" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-request-id": [ - "d3c1a740-39e1-4ace-ba6f-8c17541fce25" - ], - "x-ms-correlation-request-id": [ - "d3c1a740-39e1-4ace-ba6f-8c17541fce25" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104727Z:d3c1a740-39e1-4ace-ba6f-8c17541fce25" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:47:27 GMT" - ], - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541\",\r\n \"name\": \"pstestrg7541\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/Microsoft.Insights/components/apppstestrg7541?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNzU0MS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc3NTQxP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "196dfac9-5962-47af-8516-1ed474d7d980" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "5842ba14-cad7-4322-b976-7db53bcba4db" - ], - "x-ms-correlation-request-id": [ - "5842ba14-cad7-4322-b976-7db53bcba4db" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104728Z:5842ba14-cad7-4322-b976-7db53bcba4db" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:47:27 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "161" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg7541' under resource group 'pstestrg7541' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/Microsoft.Insights/components/apppstestrg7541?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNzU0MS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc3NTQxP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "f74d301f-d2c3-4bbb-8e90-ec786ba3ee26" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "f74d301f-d2c3-4bbb-8e90-ec786ba3ee26" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1196" - ], - "x-ms-correlation-request-id": [ - "122432a6-e93f-4033-9ee9-5f326532f2f7" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104739Z:122432a6-e93f-4033-9ee9-5f326532f2f7" - ], - "Date": [ - "Fri, 01 May 2020 10:47:38 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541\",\r\n \"name\": \"apppstestrg7541\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"07002d61-0000-0100-0000-5eabfe470000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg7541\",\r\n \"AppId\": \"052edae5-63af-4f0d-b5e4-ca26b5cc2566\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"36313663-3096-4c63-986a-47e7825197e7\",\r\n \"ConnectionString\": \"InstrumentationKey=36313663-3096-4c63-986a-47e7825197e7\",\r\n \"Name\": \"apppstestrg7541\",\r\n \"CreationDate\": \"2020-05-01T18:47:35.0033786+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/Microsoft.Insights/components/apppstestrg7541/ApiKeys?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNzU0MS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc3NTQxL0FwaUtleXM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"name\": \"test\",\r\n \"linkedReadProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/api\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/agentconfig\"\r\n ],\r\n \"linkedWriteProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/annotations\"\r\n ]\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "cb1e3639-dccd-4766-9ea5-70430449c81a" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "551" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "cb1e3639-dccd-4766-9ea5-70430449c81a" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1196" - ], - "x-ms-correlation-request-id": [ - "44acf4d5-c3e5-4bbb-bab1-bd556a5c904c" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104739Z:44acf4d5-c3e5-4bbb-bab1-bd556a5c904c" - ], - "Date": [ - "Fri, 01 May 2020 10:47:39 GMT" - ], - "Content-Length": [ - "844" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/apikeys/aead4c88-004c-46f0-b854-702af91aace2\",\r\n \"name\": \"test\",\r\n \"linkedReadProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/api\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/agentconfig\"\r\n ],\r\n \"linkedWriteProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/annotations\"\r\n ],\r\n \"apiKey\": \"o41he1proswi3f7rx8a8m6jfwspfvh3xs6hgpoca\",\r\n \"createdDate\": \"Fri, 01 May 2020 10:47:39 GMT\",\r\n \"integrationType\": null,\r\n \"integrationProperty\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/Microsoft.Insights/components/apppstestrg7541/APIKeys/aead4c88-004c-46f0-b854-702af91aace2?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNzU0MS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc3NTQxL0FQSUtleXMvYWVhZDRjODgtMDA0Yy00NmYwLWI4NTQtNzAyYWY5MWFhY2UyP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "6ed01bac-5b00-4977-9c7c-83893ed9b7c3" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "6ed01bac-5b00-4977-9c7c-83893ed9b7c3" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11991" - ], - "x-ms-correlation-request-id": [ - "4354ce96-8ef0-4610-82c5-ea71c4fb3e34" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104740Z:4354ce96-8ef0-4610-82c5-ea71c4fb3e34" - ], - "Date": [ - "Fri, 01 May 2020 10:47:39 GMT" - ], - "Content-Length": [ - "1381" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/apikeys/aead4c88-004c-46f0-b854-702af91aace2\",\r\n \"name\": \"test\",\r\n \"linkedReadProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/api\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/draft\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/extendqueries\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/search\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/aggregate\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/agentconfig\"\r\n ],\r\n \"linkedWriteProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/microsoft.insights/components/apppstestrg7541/annotations\"\r\n ],\r\n \"createdDate\": \"Fri, 01 May 2020 10:47:39 GMT\",\r\n \"integrationType\": null,\r\n \"integrationProperty\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg7541/providers/Microsoft.Insights/components/apppstestrg7541?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNzU0MS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc3NTQxP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "cda0611c-64a0-47c1-9bd0-69c7a8fd14a9" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "cda0611c-64a0-47c1-9bd0-69c7a8fd14a9" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14994" - ], - "x-ms-correlation-request-id": [ - "7bf4007f-4fac-43dd-98db-d9ef338d2182" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104743Z:7bf4007f-4fac-43dd-98db-d9ef338d2182" - ], - "Date": [ - "Fri, 01 May 2020 10:47:43 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg7541?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnNzU0MT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "6e4a72da-2fe4-4ce2-aa8d-04dd8e88df90" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzc1NDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-request-id": [ - "f8c06c68-8714-4e57-9daa-03104fb99740" - ], - "x-ms-correlation-request-id": [ - "f8c06c68-8714-4e57-9daa-03104fb99740" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104747Z:f8c06c68-8714-4e57-9daa-03104fb99740" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:47:47 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzc1NDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSemMxTkRFdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzc1NDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11995" - ], - "x-ms-request-id": [ - "97eb56f3-048f-4038-bccc-d5e1b969fef5" - ], - "x-ms-correlation-request-id": [ - "97eb56f3-048f-4038-bccc-d5e1b969fef5" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104803Z:97eb56f3-048f-4038-bccc-d5e1b969fef5" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:48:02 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzc1NDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSemMxTkRFdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzc1NDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-request-id": [ - "f7ff779d-5e70-45e3-9d86-96e6a85c5786" - ], - "x-ms-correlation-request-id": [ - "f7ff779d-5e70-45e3-9d86-96e6a85c5786" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104819Z:f7ff779d-5e70-45e3-9d86-96e6a85c5786" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:48:19 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzc1NDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSemMxTkRFdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" - ], - "x-ms-request-id": [ - "ad558581-8751-4a26-9390-f099a24c72fe" - ], - "x-ms-correlation-request-id": [ - "ad558581-8751-4a26-9390-f099a24c72fe" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104834Z:ad558581-8751-4a26-9390-f099a24c72fe" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:48:34 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzc1NDEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSemMxTkRFdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11992" - ], - "x-ms-request-id": [ - "2176cde5-04fd-4d4c-a08b-53b8520eb8fd" - ], - "x-ms-correlation-request-id": [ - "2176cde5-04fd-4d4c-a08b-53b8520eb8fd" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104835Z:2176cde5-04fd-4d4c-a08b-53b8520eb8fd" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:48:34 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-NewApplicationInsightsApiKey": [ - "pstestrg7541" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApiKeyTests/TestRemoveAppInsightsApiKey.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApiKeyTests/TestRemoveAppInsightsApiKey.json deleted file mode 100644 index a5ddb57a2da0..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApiKeyTests/TestRemoveAppInsightsApiKey.json +++ /dev/null @@ -1,879 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg3328?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMzMyOD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "bfeb4897-99bb-43b2-955b-39c2a8e69f43" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-request-id": [ - "0cf36a45-7d3f-4c0b-9c0e-0088b408b437" - ], - "x-ms-correlation-request-id": [ - "0cf36a45-7d3f-4c0b-9c0e-0088b408b437" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104527Z:0cf36a45-7d3f-4c0b-9c0e-0088b408b437" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:45:26 GMT" - ], - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328\",\r\n \"name\": \"pstestrg3328\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/Microsoft.Insights/components/apppstestrg3328?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzMyOC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczMzI4P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "67ca7c24-eae9-4d8e-957d-c26aaf1a35e1" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "b0cc18d2-c0ee-4ec9-8cb7-63d04b68d9e1" - ], - "x-ms-correlation-request-id": [ - "b0cc18d2-c0ee-4ec9-8cb7-63d04b68d9e1" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104527Z:b0cc18d2-c0ee-4ec9-8cb7-63d04b68d9e1" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:45:26 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "161" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg3328' under resource group 'pstestrg3328' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/Microsoft.Insights/components/apppstestrg3328?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzMyOC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczMzI4P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "99057e79-e1df-4f21-b301-34b1caa24ef1" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "99057e79-e1df-4f21-b301-34b1caa24ef1" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1197" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-correlation-request-id": [ - "0d6910bd-707c-4650-a871-7eb57c7c47df" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104538Z:0d6910bd-707c-4650-a871-7eb57c7c47df" - ], - "Date": [ - "Fri, 01 May 2020 10:45:37 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328\",\r\n \"name\": \"apppstestrg3328\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"0700c060-0000-0100-0000-5eabfdce0000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg3328\",\r\n \"AppId\": \"576c84b6-8960-4d17-b640-1da8af403eb2\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"4731d8a8-2c95-40fa-a7cb-b7db4b89632f\",\r\n \"ConnectionString\": \"InstrumentationKey=4731d8a8-2c95-40fa-a7cb-b7db4b89632f\",\r\n \"Name\": \"apppstestrg3328\",\r\n \"CreationDate\": \"2020-05-01T18:45:34.7804986+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/Microsoft.Insights/components/apppstestrg3328/ApiKeys?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzMyOC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczMzI4L0FwaUtleXM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"name\": \"test\",\r\n \"linkedReadProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/api\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/agentconfig\"\r\n ],\r\n \"linkedWriteProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/annotations\"\r\n ]\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "55d9d439-33bb-40b3-8a4e-13918c842417" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "551" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "55d9d439-33bb-40b3-8a4e-13918c842417" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1197" - ], - "x-ms-correlation-request-id": [ - "0f909962-00ba-4b51-89f3-518744381fb8" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104538Z:0f909962-00ba-4b51-89f3-518744381fb8" - ], - "Date": [ - "Fri, 01 May 2020 10:45:37 GMT" - ], - "Content-Length": [ - "844" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/apikeys/04e91185-edd5-4bd0-aebb-3cd351e29986\",\r\n \"name\": \"test\",\r\n \"linkedReadProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/api\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/agentconfig\"\r\n ],\r\n \"linkedWriteProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/annotations\"\r\n ],\r\n \"apiKey\": \"o7yfdrjmemoe1ob2bayfx5krrw3fn18unej0yet6\",\r\n \"createdDate\": \"Fri, 01 May 2020 10:45:38 GMT\",\r\n \"integrationType\": null,\r\n \"integrationProperty\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/Microsoft.Insights/components/apppstestrg3328/APIKeys/04e91185-edd5-4bd0-aebb-3cd351e29986?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzMyOC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczMzI4L0FQSUtleXMvMDRlOTExODUtZWRkNS00YmQwLWFlYmItM2NkMzUxZTI5OTg2P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "3c663c36-ab27-4943-a122-b7607e7b572f" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "3c663c36-ab27-4943-a122-b7607e7b572f" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" - ], - "x-ms-correlation-request-id": [ - "16004a5a-79c4-477f-8a3c-3d6f6d1c273b" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104539Z:16004a5a-79c4-477f-8a3c-3d6f6d1c273b" - ], - "Date": [ - "Fri, 01 May 2020 10:45:39 GMT" - ], - "Content-Length": [ - "1381" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/apikeys/04e91185-edd5-4bd0-aebb-3cd351e29986\",\r\n \"name\": \"test\",\r\n \"linkedReadProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/api\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/draft\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/extendqueries\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/search\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/aggregate\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/agentconfig\"\r\n ],\r\n \"linkedWriteProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/annotations\"\r\n ],\r\n \"createdDate\": \"Fri, 01 May 2020 10:45:38 GMT\",\r\n \"integrationType\": null,\r\n \"integrationProperty\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/Microsoft.Insights/components/apppstestrg3328/APIKeys/04e91185-edd5-4bd0-aebb-3cd351e29986?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzMyOC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczMzI4L0FQSUtleXMvMDRlOTExODUtZWRkNS00YmQwLWFlYmItM2NkMzUxZTI5OTg2P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "e28f20b3-bec5-487d-837a-51e7886ad2d2" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "e28f20b3-bec5-487d-837a-51e7886ad2d2" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14995" - ], - "x-ms-correlation-request-id": [ - "a6c43b65-ef1b-4a74-bc13-75576e088096" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104539Z:a6c43b65-ef1b-4a74-bc13-75576e088096" - ], - "Date": [ - "Fri, 01 May 2020 10:45:39 GMT" - ], - "Content-Length": [ - "1381" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/apikeys/04e91185-edd5-4bd0-aebb-3cd351e29986\",\r\n \"name\": \"test\",\r\n \"linkedReadProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/api\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/draft\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/extendqueries\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/search\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/aggregate\",\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/agentconfig\"\r\n ],\r\n \"linkedWriteProperties\": [\r\n \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3328/providers/microsoft.insights/components/apppstestrg3328/annotations\"\r\n ],\r\n \"createdDate\": \"Fri, 01 May 2020 10:45:38 GMT\",\r\n \"integrationType\": null,\r\n \"integrationProperty\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg3328?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMzMyOD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "713c8ec0-edc7-4517-b41a-58acdf5ac107" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-request-id": [ - "a6d7ee15-d36a-4db5-8b9e-f03fccb762cf" - ], - "x-ms-correlation-request-id": [ - "a6d7ee15-d36a-4db5-8b9e-f03fccb762cf" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104544Z:a6d7ee15-d36a-4db5-8b9e-f03fccb762cf" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:45:44 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek16TWpndFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" - ], - "x-ms-request-id": [ - "520fd9b3-017c-413d-9074-1b5eb5013f72" - ], - "x-ms-correlation-request-id": [ - "520fd9b3-017c-413d-9074-1b5eb5013f72" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104600Z:520fd9b3-017c-413d-9074-1b5eb5013f72" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:46:00 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek16TWpndFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-request-id": [ - "06453e92-bfcf-489d-9da0-b11a8fa91065" - ], - "x-ms-correlation-request-id": [ - "06453e92-bfcf-489d-9da0-b11a8fa91065" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104616Z:06453e92-bfcf-489d-9da0-b11a8fa91065" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:46:15 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek16TWpndFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-request-id": [ - "c4505838-882f-4c0a-860e-6f41c60802d9" - ], - "x-ms-correlation-request-id": [ - "c4505838-882f-4c0a-860e-6f41c60802d9" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104631Z:c4505838-882f-4c0a-860e-6f41c60802d9" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:46:31 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek16TWpndFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-request-id": [ - "fd280826-fd9d-4642-9098-71d5b24db73b" - ], - "x-ms-correlation-request-id": [ - "fd280826-fd9d-4642-9098-71d5b24db73b" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104647Z:fd280826-fd9d-4642-9098-71d5b24db73b" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:46:46 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek16TWpndFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11995" - ], - "x-ms-request-id": [ - "765ae3d1-d568-443d-93a2-f91f5cdb3415" - ], - "x-ms-correlation-request-id": [ - "765ae3d1-d568-443d-93a2-f91f5cdb3415" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104702Z:765ae3d1-d568-443d-93a2-f91f5cdb3415" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:47:02 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek16TWpndFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-request-id": [ - "67a7f66a-5a42-489e-8bf4-0d218a9e9ce6" - ], - "x-ms-correlation-request-id": [ - "67a7f66a-5a42-489e-8bf4-0d218a9e9ce6" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104718Z:67a7f66a-5a42-489e-8bf4-0d218a9e9ce6" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:47:17 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMzMjgtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek16TWpndFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" - ], - "x-ms-request-id": [ - "5cec8f7d-9dd8-4ade-8281-31e9568097f7" - ], - "x-ms-correlation-request-id": [ - "5cec8f7d-9dd8-4ade-8281-31e9568097f7" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20200501T104718Z:5cec8f7d-9dd8-4ade-8281-31e9568097f7" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Fri, 01 May 2020 10:47:18 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-RemoveApplicationInsightsApiKey": [ - "pstestrg3328" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestAppInsightsCRUD.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestAppInsightsCRUD.json deleted file mode 100644 index 0d0f37cddae8..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestAppInsightsCRUD.json +++ /dev/null @@ -1,917 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlZ3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "9425d48a-a259-496c-ad86-7098bfc97545" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.36" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-request-id": [ - "8ce05936-ceef-4321-8ebb-051c7bfdf83f" - ], - "x-ms-correlation-request-id": [ - "8ce05936-ceef-4321-8ebb-051c7bfdf83f" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020830Z:8ce05936-ceef-4321-8ebb-051c7bfdf83f" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Mon, 28 Jun 2021 02:08:30 GMT" - ], - "Content-Length": [ - "193" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock\",\r\n \"name\": \"azps-test-group-mock\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Insights/components/azps-test-ai-mock?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jaz9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "fed3f504-5048-4b1c-a059-0951a39ffec5" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "14f3a983-2d47-4e58-9a2f-14ac2b4964ea" - ], - "x-ms-correlation-request-id": [ - "14f3a983-2d47-4e58-9a2f-14ac2b4964ea" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020832Z:14f3a983-2d47-4e58-9a2f-14ac2b4964ea" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Mon, 28 Jun 2021 02:08:31 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "239" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/azps-test-ai-mock' under resource group 'azps-test-group-mock' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Insights/components/azps-test-ai-mock?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jaz9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "20773a4f-2027-4078-a7be-81dea45cc32c" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "20773a4f-2027-4078-a7be-81dea45cc32c" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-correlation-request-id": [ - "c03e3bdd-89ab-4a97-960f-0086ee658708" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020842Z:c03e3bdd-89ab-4a97-960f-0086ee658708" - ], - "Date": [ - "Mon, 28 Jun 2021 02:08:41 GMT" - ], - "Content-Length": [ - "1034" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock\",\r\n \"name\": \"azps-test-ai-mock\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"d200bd56-0000-0100-0000-60d92f250000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"azps-test-ai-mock\",\r\n \"AppId\": \"2e17ed27-f186-4a91-963e-2212b9f75c91\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"a9870002-f132-4156-b76d-88e51adf1451\",\r\n \"ConnectionString\": \"InstrumentationKey=a9870002-f132-4156-b76d-88e51adf1451;IngestionEndpoint=https://eastus-0.in.applicationinsights.azure.com/\",\r\n \"Name\": \"azps-test-ai-mock\",\r\n \"CreationDate\": \"2021-06-28T10:08:37.7068107+08:00\",\r\n \"TenantId\": \"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"RetentionInDays\": 90,\r\n \"IngestionMode\": \"ApplicationInsights\",\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Insights/components/azps-test-ai-mock?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jaz9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "3ba66ec6-3bc3-4af9-bbd8-6018ebe37a22" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "3ba66ec6-3bc3-4af9-bbd8-6018ebe37a22" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-correlation-request-id": [ - "2cd9897f-c64a-4ae6-b157-c82a3c4070fe" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020842Z:2cd9897f-c64a-4ae6-b157-c82a3c4070fe" - ], - "Date": [ - "Mon, 28 Jun 2021 02:08:42 GMT" - ], - "Content-Length": [ - "1034" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock\",\r\n \"name\": \"azps-test-ai-mock\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"d200bd56-0000-0100-0000-60d92f250000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"azps-test-ai-mock\",\r\n \"AppId\": \"2e17ed27-f186-4a91-963e-2212b9f75c91\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"a9870002-f132-4156-b76d-88e51adf1451\",\r\n \"ConnectionString\": \"InstrumentationKey=a9870002-f132-4156-b76d-88e51adf1451;IngestionEndpoint=https://eastus-0.in.applicationinsights.azure.com/\",\r\n \"Name\": \"azps-test-ai-mock\",\r\n \"CreationDate\": \"2021-06-28T10:08:37.7068107+08:00\",\r\n \"TenantId\": \"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"RetentionInDays\": 90,\r\n \"IngestionMode\": \"ApplicationInsights\",\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Insights/components/azps-test-ai-mock?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jaz9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "fed3f504-5048-4b1c-a059-0951a39ffec5" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "fed3f504-5048-4b1c-a059-0951a39ffec5" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "a81683dd-3913-4c91-a48f-c6658b63a631" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020841Z:a81683dd-3913-4c91-a48f-c6658b63a631" - ], - "Date": [ - "Mon, 28 Jun 2021 02:08:41 GMT" - ], - "Content-Length": [ - "1034" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock\",\r\n \"name\": \"azps-test-ai-mock\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"d200bd56-0000-0100-0000-60d92f250000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"azps-test-ai-mock\",\r\n \"AppId\": \"2e17ed27-f186-4a91-963e-2212b9f75c91\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"a9870002-f132-4156-b76d-88e51adf1451\",\r\n \"ConnectionString\": \"InstrumentationKey=a9870002-f132-4156-b76d-88e51adf1451;IngestionEndpoint=https://eastus-0.in.applicationinsights.azure.com/\",\r\n \"Name\": \"azps-test-ai-mock\",\r\n \"CreationDate\": \"2021-06-28T10:08:37.7068107+08:00\",\r\n \"TenantId\": \"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"RetentionInDays\": 90,\r\n \"IngestionMode\": \"ApplicationInsights\",\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Insights/components/azps-test-ai-mock?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jaz9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"RetentionInDays\": 90,\r\n \"publicNetworkAccessForIngestion\": \"Disabled\",\r\n \"publicNetworkAccessForQuery\": \"Disabled\"\r\n },\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"key\": \"val\"\r\n }\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "3ba66ec6-3bc3-4af9-bbd8-6018ebe37a22" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "309" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "3ba66ec6-3bc3-4af9-bbd8-6018ebe37a22" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "11126104-5a4c-49bd-be79-b230e616c6f2" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020847Z:11126104-5a4c-49bd-be79-b230e616c6f2" - ], - "Date": [ - "Mon, 28 Jun 2021 02:08:46 GMT" - ], - "Content-Length": [ - "1066" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock\",\r\n \"name\": \"azps-test-ai-mock\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"key\": \"val\"\r\n },\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"d200c256-0000-0100-0000-60d92f2c0000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"azps-test-ai-mock\",\r\n \"AppId\": \"2e17ed27-f186-4a91-963e-2212b9f75c91\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"a9870002-f132-4156-b76d-88e51adf1451\",\r\n \"ConnectionString\": \"InstrumentationKey=a9870002-f132-4156-b76d-88e51adf1451;IngestionEndpoint=https://eastus-0.in.applicationinsights.azure.com/\",\r\n \"Name\": \"azps-test-ai-mock\",\r\n \"CreationDate\": \"2021-06-28T10:08:37.7068107+08:00\",\r\n \"TenantId\": \"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"RetentionInDays\": 90,\r\n \"Retention\": \"P90D\",\r\n \"IngestionMode\": \"ApplicationInsights\",\r\n \"publicNetworkAccessForIngestion\": \"Disabled\",\r\n \"publicNetworkAccessForQuery\": \"Disabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Insights/components?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cz9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "d65058cc-c70e-4038-9253-8e5dd4b0550a" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "d65058cc-c70e-4038-9253-8e5dd4b0550a" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-correlation-request-id": [ - "72b95a84-a7de-4eb2-90d6-f5ae2d4eba37" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020842Z:72b95a84-a7de-4eb2-90d6-f5ae2d4eba37" - ], - "Date": [ - "Mon, 28 Jun 2021 02:08:41 GMT" - ], - "Content-Length": [ - "1077" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock\",\r\n \"name\": \"azps-test-ai-mock\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"d200bd56-0000-0100-0000-60d92f250000\\\"\",\r\n \"properties\": {\r\n \"ApplicationId\": \"azps-test-ai-mock\",\r\n \"AppId\": \"2e17ed27-f186-4a91-963e-2212b9f75c91\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"a9870002-f132-4156-b76d-88e51adf1451\",\r\n \"ConnectionString\": \"InstrumentationKey=a9870002-f132-4156-b76d-88e51adf1451;IngestionEndpoint=https://eastus-0.in.applicationinsights.azure.com/\",\r\n \"Name\": \"azps-test-ai-mock\",\r\n \"CreationDate\": \"2021-06-28T10:08:37.7068107+08:00\",\r\n \"TenantId\": \"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"RetentionInDays\": 90,\r\n \"IngestionMode\": \"ApplicationInsights\",\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n }\r\n ],\r\n \"nextLink\": null,\r\n \"properties\": {\r\n \"Ver\": \"v2\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Insights/components/azps-test-ai-mock?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jaz9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "38f88f52-ae1c-42f3-be0a-92b427fa8b3f" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "38f88f52-ae1c-42f3-be0a-92b427fa8b3f" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-correlation-request-id": [ - "065aa32d-4c40-4971-89ca-fb925c292571" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020853Z:065aa32d-4c40-4971-89ca-fb925c292571" - ], - "Date": [ - "Mon, 28 Jun 2021 02:08:53 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlZ3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "04f8eafb-e351-4ff7-bd2b-6aeb511baacd" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.36" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-request-id": [ - "907728db-2ef9-4cea-b073-3474acd0748c" - ], - "x-ms-correlation-request-id": [ - "907728db-2ef9-4cea-b073-3474acd0748c" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020856Z:907728db-2ef9-4cea-b073-3474acd0748c" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Mon, 28 Jun 2021 02:08:56 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlZ3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "0421096c-ae2f-479d-bdb4-25cbe843f917" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.36" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-request-id": [ - "0ac62ada-508c-4400-b973-52333a305cd7" - ], - "x-ms-correlation-request-id": [ - "0ac62ada-508c-4400-b973-52333a305cd7" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020944Z:0ac62ada-508c-4400-b973-52333a305cd7" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Mon, 28 Jun 2021 02:09:43 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "112" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'azps-test-group-mock' could not be found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xCVE9qSkVWRVZUVkRveVJFZFNUMVZRT2pKRVRVOURTeTFGUVZOVVZWTWlMQ0pxYjJKTWIyTmhkR2x2YmlJNkltVmhjM1IxY3lKOT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.36" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" - ], - "x-ms-request-id": [ - "706f5870-7473-4d3f-86ce-6cfeac83ee40" - ], - "x-ms-correlation-request-id": [ - "706f5870-7473-4d3f-86ce-6cfeac83ee40" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020912Z:706f5870-7473-4d3f-86ce-6cfeac83ee40" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Mon, 28 Jun 2021 02:09:11 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xCVE9qSkVWRVZUVkRveVJFZFNUMVZRT2pKRVRVOURTeTFGUVZOVVZWTWlMQ0pxYjJKTWIyTmhkR2x2YmlJNkltVmhjM1IxY3lKOT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.36" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-request-id": [ - "fe08016a-e16b-4abe-9ec6-2ee61d7bef66" - ], - "x-ms-correlation-request-id": [ - "fe08016a-e16b-4abe-9ec6-2ee61d7bef66" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020927Z:fe08016a-e16b-4abe-9ec6-2ee61d7bef66" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Mon, 28 Jun 2021 02:09:27 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xCVE9qSkVWRVZUVkRveVJFZFNUMVZRT2pKRVRVOURTeTFGUVZOVVZWTWlMQ0pxYjJKTWIyTmhkR2x2YmlJNkltVmhjM1IxY3lKOT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.36" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-request-id": [ - "82b1820e-a560-409c-bb44-92234d6f6838" - ], - "x-ms-correlation-request-id": [ - "82b1820e-a560-409c-bb44-92234d6f6838" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020943Z:82b1820e-a560-409c-bb44-92234d6f6838" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Mon, 28 Jun 2021 02:09:42 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xCVE9qSkVWRVZUVkRveVJFZFNUMVZRT2pKRVRVOURTeTFGUVZOVVZWTWlMQ0pxYjJKTWIyTmhkR2x2YmlJNkltVmhjM1IxY3lKOT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.21390.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.36" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-request-id": [ - "7f2265ec-5933-4627-945b-d2809122e6b1" - ], - "x-ms-correlation-request-id": [ - "7f2265ec-5933-4627-945b-d2809122e6b1" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20210628T020943Z:7f2265ec-5933-4627-945b-d2809122e6b1" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Mon, 28 Jun 2021 02:09:42 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": {}, - "Variables": { - "SubscriptionId": "9e223dbe-3399-4e19-88eb-0975f02ac87f" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestGetAppInsights.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestGetAppInsights.json deleted file mode 100644 index 469a4fcd4706..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestGetAppInsights.json +++ /dev/null @@ -1,534 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourcegroups/pstestrg4175?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnNDE3NT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg4175\",\r\n \"name\": \"pstestrg4175\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-request-id": [ - "f4f6b865-8214-410f-8d52-e446ec298a87" - ], - "x-ms-correlation-request-id": [ - "f4f6b865-8214-410f-8d52-e446ec298a87" - ], - "x-ms-routing-request-id": [ - "WESTUS2:20171006T201812Z:f4f6b865-8214-410f-8d52-e446ec298a87" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:18:11 GMT" - ] - }, - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg4175/providers/microsoft.insights/components/apppstestrg4175?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNDE3NS9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc0MTc1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "1e4e4b44-d7db-4469-84c6-e01a51e844a5" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'microsoft.insights/components/apppstestrg4175' under resource group 'pstestrg4175' was not found.\"\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "161" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "af528f2c-03b8-4ce1-b9a4-d657fffbe964" - ], - "x-ms-correlation-request-id": [ - "af528f2c-03b8-4ce1-b9a4-d657fffbe964" - ], - "x-ms-routing-request-id": [ - "WESTUS2:20171006T201813Z:af528f2c-03b8-4ce1-b9a4-d657fffbe964" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:18:13 GMT" - ] - }, - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg4175/providers/microsoft.insights/components/apppstestrg4175?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNDE3NS9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc0MTc1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ], - "x-ms-client-request-id": [ - "8343a0f2-cab5-474c-a875-0871a19a7c4f" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg4175/providers/microsoft.insights/components/apppstestrg4175\",\r\n \"name\": \"apppstestrg4175\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"390028eb-0000-0000-0000-59d7e5090000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg4175\",\r\n \"AppId\": \"9dfdee0f-41ff-4ecc-8b35-246c6fe0687b\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"1d827f06-c4e2-4c2a-9ccf-73ff864ee64f\",\r\n \"Name\": \"apppstestrg4175\",\r\n \"CreationDate\": \"2017-10-06T13:18:16.1327734-07:00\",\r\n \"PackageId\": null,\r\n \"TenantId\": \"8b41dbed-3445-4071-893b-0d78932d36df\",\r\n \"HockeyAppId\": null,\r\n \"HockeyAppToken\": null,\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "787" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "8343a0f2-cab5-474c-a875-0871a19a7c4f" - ], - "x-content-type-options": [ - "nosniff", - "nosniff" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "471e0b94-7220-4b41-a46f-ed00ac7ae254" - ], - "x-ms-routing-request-id": [ - "WESTUS2:20171006T201818Z:471e0b94-7220-4b41-a46f-ed00ac7ae254" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:18:17 GMT" - ], - "Server": [ - "Microsoft-IIS/8.5" - ], - "X-Powered-By": [ - "ASP.NET" - ] - }, - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg4175/providers/microsoft.insights/components?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNDE3NS9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "ce40af67-42c1-47e3-8072-5ad54ba710d4" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg4175/providers/microsoft.insights/components/apppstestrg4175\",\r\n \"name\": \"apppstestrg4175\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"390028eb-0000-0000-0000-59d7e5090000\\\"\",\r\n \"properties\": {\r\n \"ApplicationId\": \"apppstestrg4175\",\r\n \"AppId\": \"9dfdee0f-41ff-4ecc-8b35-246c6fe0687b\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"1d827f06-c4e2-4c2a-9ccf-73ff864ee64f\",\r\n \"Name\": \"apppstestrg4175\",\r\n \"CreationDate\": \"2017-10-06T13:18:16.1327734-07:00\",\r\n \"PackageId\": null,\r\n \"TenantId\": \"8b41dbed-3445-4071-893b-0d78932d36df\",\r\n \"HockeyAppId\": null,\r\n \"HockeyAppToken\": null,\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null\r\n }\r\n }\r\n ],\r\n \"nextLink\": null,\r\n \"properties\": {\r\n \"Ver\": \"v2\"\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "830" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "ce40af67-42c1-47e3-8072-5ad54ba710d4" - ], - "x-content-type-options": [ - "nosniff", - "nosniff" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14960" - ], - "x-ms-correlation-request-id": [ - "ccae725b-fead-4b71-bd86-72725dfac835" - ], - "x-ms-routing-request-id": [ - "WESTUS2:20171006T201819Z:ccae725b-fead-4b71-bd86-72725dfac835" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:18:18 GMT" - ], - "Server": [ - "Microsoft-IIS/8.5" - ], - "X-Powered-By": [ - "ASP.NET" - ] - }, - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg4175/providers/microsoft.insights/components/apppstestrg4175?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNDE3NS9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc0MTc1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "4955c1ab-9b32-4d68-9f66-fe1736d6dc33" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "4955c1ab-9b32-4d68-9f66-fe1736d6dc33" - ], - "x-content-type-options": [ - "nosniff", - "nosniff" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "afaaf40e-044a-464b-b6cb-0ed41d4fd244" - ], - "x-ms-routing-request-id": [ - "WESTUS2:20171006T201821Z:afaaf40e-044a-464b-b6cb-0ed41d4fd244" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:18:20 GMT" - ], - "Server": [ - "Microsoft-IIS/8.5" - ], - "X-Powered-By": [ - "ASP.NET" - ] - }, - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourcegroups/pstestrg4175?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnNDE3NT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-request-id": [ - "f42a8781-db83-4074-93e2-f4052039fa1a" - ], - "x-ms-correlation-request-id": [ - "f42a8781-db83-4074-93e2-f4052039fa1a" - ], - "x-ms-routing-request-id": [ - "WESTUS2:20171006T201822Z:f42a8781-db83-4074-93e2-f4052039fa1a" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:18:22 GMT" - ], - "Location": [ - "https://management.azure.com/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzQxNzUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" - ] - }, - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzQxNzUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSelF4TnpVdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-version": [ - "2016-02-01" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14959" - ], - "x-ms-request-id": [ - "09010a61-bf13-45a6-9da3-a0248893b9bf" - ], - "x-ms-correlation-request-id": [ - "09010a61-bf13-45a6-9da3-a0248893b9bf" - ], - "x-ms-routing-request-id": [ - "WESTUS2:20171006T201822Z:09010a61-bf13-45a6-9da3-a0248893b9bf" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:18:22 GMT" - ], - "Location": [ - "https://management.azure.com/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzQxNzUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" - ] - }, - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzQxNzUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSelF4TnpVdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-version": [ - "2016-02-01" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14958" - ], - "x-ms-request-id": [ - "09a1b080-f96d-4863-867f-f8b3a1d31a75" - ], - "x-ms-correlation-request-id": [ - "09a1b080-f96d-4863-867f-f8b3a1d31a75" - ], - "x-ms-routing-request-id": [ - "WESTUS2:20171006T201837Z:09a1b080-f96d-4863-867f-f8b3a1d31a75" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:18:37 GMT" - ], - "Location": [ - "https://management.azure.com/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzQxNzUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" - ] - }, - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzQxNzUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSelF4TnpVdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-version": [ - "2016-02-01" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14957" - ], - "x-ms-request-id": [ - "22cbce81-bf03-48fc-9cbd-80080cff70d5" - ], - "x-ms-correlation-request-id": [ - "22cbce81-bf03-48fc-9cbd-80080cff70d5" - ], - "x-ms-routing-request-id": [ - "WESTUS2:20171006T201853Z:22cbce81-bf03-48fc-9cbd-80080cff70d5" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:18:52 GMT" - ] - }, - "StatusCode": 200 - } - ], - "Names": { - "Test-GetApplicationInsights": [ - "pstestrg4175" - ] - }, - "Variables": { - "SubscriptionId": "b90b0dec-9b9a-4778-a84e-4ffb73bb17f6" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestNewAppInsights.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestNewAppInsights.json deleted file mode 100644 index abe4f57239b9..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestNewAppInsights.json +++ /dev/null @@ -1,588 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourcegroups/pstestrg2884?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjg4ND9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2884\",\r\n \"name\": \"pstestrg2884\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-request-id": [ - "83579e0d-1247-40c7-a75e-f17df3bad5e7" - ], - "x-ms-correlation-request-id": [ - "83579e0d-1247-40c7-a75e-f17df3bad5e7" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T202246Z:83579e0d-1247-40c7-a75e-f17df3bad5e7" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:22:45 GMT" - ] - }, - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2884/providers/microsoft.insights/components/apppstestrg2884?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjg4NC9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyODg0P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "52b9f7c6-fb9b-4d99-8ca3-8c1ac9d6b784" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'microsoft.insights/components/apppstestrg2884' under resource group 'pstestrg2884' was not found.\"\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "161" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "6985ad52-f889-4ab6-acc0-c4dffc58f5c9" - ], - "x-ms-correlation-request-id": [ - "6985ad52-f889-4ab6-acc0-c4dffc58f5c9" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T202247Z:6985ad52-f889-4ab6-acc0-c4dffc58f5c9" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:22:46 GMT" - ] - }, - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2884/providers/microsoft.insights/components/apppstestrg2884?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjg4NC9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyODg0P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "ff026492-ad4f-4475-a5d4-c554bc0c3590" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2884/providers/microsoft.insights/components/apppstestrg2884\",\r\n \"name\": \"apppstestrg2884\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"390099eb-0000-0000-0000-59d7e61a0000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg2884\",\r\n \"AppId\": \"e2b4b40a-fe50-42d0-95da-3fc82a2f2dd1\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"e56541e5-0d48-4949-a6fe-1892f8ddcffc\",\r\n \"Name\": \"apppstestrg2884\",\r\n \"CreationDate\": \"2017-10-06T13:22:49.2001319-07:00\",\r\n \"PackageId\": null,\r\n \"TenantId\": \"8b41dbed-3445-4071-893b-0d78932d36df\",\r\n \"HockeyAppId\": null,\r\n \"HockeyAppToken\": null,\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "787" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "ff026492-ad4f-4475-a5d4-c554bc0c3590" - ], - "x-content-type-options": [ - "nosniff", - "nosniff" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14980" - ], - "x-ms-correlation-request-id": [ - "16645da6-e71e-4f73-bf5c-3cb53161e875" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T202251Z:16645da6-e71e-4f73-bf5c-3cb53161e875" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:22:50 GMT" - ], - "Server": [ - "Microsoft-IIS/8.5" - ], - "X-Powered-By": [ - "ASP.NET" - ] - }, - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2884/providers/microsoft.insights/components/apppstestrg2884?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjg4NC9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyODg0P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ], - "x-ms-client-request-id": [ - "26b7843c-bb30-44c8-8645-3e638c74707b" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2884/providers/microsoft.insights/components/apppstestrg2884\",\r\n \"name\": \"apppstestrg2884\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"390099eb-0000-0000-0000-59d7e61a0000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg2884\",\r\n \"AppId\": \"e2b4b40a-fe50-42d0-95da-3fc82a2f2dd1\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"e56541e5-0d48-4949-a6fe-1892f8ddcffc\",\r\n \"Name\": \"apppstestrg2884\",\r\n \"CreationDate\": \"2017-10-06T13:22:49.2001319-07:00\",\r\n \"PackageId\": null,\r\n \"TenantId\": \"8b41dbed-3445-4071-893b-0d78932d36df\",\r\n \"HockeyAppId\": null,\r\n \"HockeyAppToken\": null,\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "787" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "26b7843c-bb30-44c8-8645-3e638c74707b" - ], - "x-content-type-options": [ - "nosniff", - "nosniff" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "d6364cc8-d934-4e9b-a464-02287faaa1fa" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T202251Z:d6364cc8-d934-4e9b-a464-02287faaa1fa" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:22:50 GMT" - ], - "Server": [ - "Microsoft-IIS/8.5" - ], - "X-Powered-By": [ - "ASP.NET" - ] - }, - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2884/providers/microsoft.insights/components/apppstestrg2884?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjg4NC9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyODg0P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "97ea1bc8-203b-4500-8b3d-7f872cc64818" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "97ea1bc8-203b-4500-8b3d-7f872cc64818" - ], - "x-content-type-options": [ - "nosniff", - "nosniff" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "85c570cb-cfa1-45bc-8306-a939f0302e26" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T202253Z:85c570cb-cfa1-45bc-8306-a939f0302e26" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:22:52 GMT" - ], - "Server": [ - "Microsoft-IIS/8.5" - ], - "X-Powered-By": [ - "ASP.NET" - ] - }, - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourcegroups/pstestrg2884?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjg4ND9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-request-id": [ - "15859a17-57ef-4ef3-a36c-f4dc5ffe0052" - ], - "x-ms-correlation-request-id": [ - "15859a17-57ef-4ef3-a36c-f4dc5ffe0052" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T202254Z:15859a17-57ef-4ef3-a36c-f4dc5ffe0052" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:22:54 GMT" - ], - "Location": [ - "https://management.azure.com/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI4ODQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" - ] - }, - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI4ODQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekk0T0RRdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-version": [ - "2016-02-01" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14975" - ], - "x-ms-request-id": [ - "a4ab8b5f-b2bc-4fc6-9f6b-f8f1b35af877" - ], - "x-ms-correlation-request-id": [ - "a4ab8b5f-b2bc-4fc6-9f6b-f8f1b35af877" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T202255Z:a4ab8b5f-b2bc-4fc6-9f6b-f8f1b35af877" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:22:55 GMT" - ], - "Location": [ - "https://management.azure.com/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI4ODQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" - ] - }, - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI4ODQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekk0T0RRdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-version": [ - "2016-02-01" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14974" - ], - "x-ms-request-id": [ - "2ed10646-9439-481e-8705-62577f934165" - ], - "x-ms-correlation-request-id": [ - "2ed10646-9439-481e-8705-62577f934165" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T202310Z:2ed10646-9439-481e-8705-62577f934165" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:23:10 GMT" - ], - "Location": [ - "https://management.azure.com/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI4ODQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" - ] - }, - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI4ODQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekk0T0RRdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-version": [ - "2016-02-01" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14973" - ], - "x-ms-request-id": [ - "1b277d7c-0352-40ab-b3e6-c4c97217e696" - ], - "x-ms-correlation-request-id": [ - "1b277d7c-0352-40ab-b3e6-c4c97217e696" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T202325Z:1b277d7c-0352-40ab-b3e6-c4c97217e696" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:23:25 GMT" - ], - "Location": [ - "https://management.azure.com/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI4ODQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" - ] - }, - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI4ODQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekk0T0RRdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-version": [ - "2016-02-01" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14972" - ], - "x-ms-request-id": [ - "b2776fa5-520e-4c11-8c00-a3df61304d45" - ], - "x-ms-correlation-request-id": [ - "b2776fa5-520e-4c11-8c00-a3df61304d45" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T202341Z:b2776fa5-520e-4c11-8c00-a3df61304d45" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:23:41 GMT" - ] - }, - "StatusCode": 200 - } - ], - "Names": { - "Test-NewApplicationInsights": [ - "pstestrg2884" - ] - }, - "Variables": { - "SubscriptionId": "b90b0dec-9b9a-4778-a84e-4ffb73bb17f6" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestRemoveAppInsights.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestRemoveAppInsights.json deleted file mode 100644 index 86febf6f03f1..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ApplicationInsightsTests/TestRemoveAppInsights.json +++ /dev/null @@ -1,591 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourcegroups/pstestrg2645?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjY0NT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2645\",\r\n \"name\": \"pstestrg2645\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1197" - ], - "x-ms-request-id": [ - "6914774e-c5bd-41ff-bf9e-c8ab66e80e7d" - ], - "x-ms-correlation-request-id": [ - "6914774e-c5bd-41ff-bf9e-c8ab66e80e7d" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T203530Z:6914774e-c5bd-41ff-bf9e-c8ab66e80e7d" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:35:29 GMT" - ] - }, - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2645/providers/microsoft.insights/components/apppstestrg2645?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjY0NS9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNjQ1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "edab7f37-ffbb-48d4-9f23-6d61ccb25acb" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'microsoft.insights/components/apppstestrg2645' under resource group 'pstestrg2645' was not found.\"\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "161" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "47f1a00e-cbe6-4da7-9706-960806592502" - ], - "x-ms-correlation-request-id": [ - "47f1a00e-cbe6-4da7-9706-960806592502" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T203530Z:47f1a00e-cbe6-4da7-9706-960806592502" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:35:29 GMT" - ] - }, - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2645/providers/microsoft.insights/components/apppstestrg2645?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjY0NS9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNjQ1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "3c17da34-2a06-4d15-9736-131bca4b9a4e" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2645/providers/microsoft.insights/components/apppstestrg2645\",\r\n \"name\": \"apppstestrg2645\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"390079ec-0000-0000-0000-59d7e9150000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg2645\",\r\n \"AppId\": \"52751a71-d37c-421c-80f7-9864f9ef477a\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"dc0f5363-d7e2-4fc8-a61c-83b49b3262a5\",\r\n \"Name\": \"apppstestrg2645\",\r\n \"CreationDate\": \"2017-10-06T13:35:32.74515-07:00\",\r\n \"PackageId\": null,\r\n \"TenantId\": \"8b41dbed-3445-4071-893b-0d78932d36df\",\r\n \"HockeyAppId\": null,\r\n \"HockeyAppToken\": null,\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "785" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "3c17da34-2a06-4d15-9736-131bca4b9a4e" - ], - "x-content-type-options": [ - "nosniff", - "nosniff" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14980" - ], - "x-ms-correlation-request-id": [ - "6c1fc7cf-8d34-4dd8-9685-d81a8b6d80a9" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T203535Z:6c1fc7cf-8d34-4dd8-9685-d81a8b6d80a9" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:35:34 GMT" - ], - "Server": [ - "Microsoft-IIS/8.5" - ], - "X-Powered-By": [ - "ASP.NET" - ] - }, - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2645/providers/microsoft.insights/components/apppstestrg2645?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjY0NS9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNjQ1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "bb07333f-8caf-4986-a141-35be179900d6" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'microsoft.insights/components/apppstestrg2645' under resource group 'pstestrg2645' was not found.\"\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "161" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "22102d3a-fdbf-455b-b7b1-05eddf635879" - ], - "x-ms-correlation-request-id": [ - "22102d3a-fdbf-455b-b7b1-05eddf635879" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T203537Z:22102d3a-fdbf-455b-b7b1-05eddf635879" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:35:37 GMT" - ] - }, - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2645/providers/microsoft.insights/components/apppstestrg2645?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjY0NS9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNjQ1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ], - "x-ms-client-request-id": [ - "5146d611-eb0a-4c84-a1f9-841f918dc79b" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2645/providers/microsoft.insights/components/apppstestrg2645\",\r\n \"name\": \"apppstestrg2645\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"390079ec-0000-0000-0000-59d7e9150000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg2645\",\r\n \"AppId\": \"52751a71-d37c-421c-80f7-9864f9ef477a\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"dc0f5363-d7e2-4fc8-a61c-83b49b3262a5\",\r\n \"Name\": \"apppstestrg2645\",\r\n \"CreationDate\": \"2017-10-06T13:35:32.74515-07:00\",\r\n \"PackageId\": null,\r\n \"TenantId\": \"8b41dbed-3445-4071-893b-0d78932d36df\",\r\n \"HockeyAppId\": null,\r\n \"HockeyAppToken\": null,\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null\r\n }\r\n}", - "ResponseHeaders": { - "Content-Length": [ - "785" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "5146d611-eb0a-4c84-a1f9-841f918dc79b" - ], - "x-content-type-options": [ - "nosniff", - "nosniff" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "6b362b7e-a210-4d52-93b4-541731f57de8" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T203534Z:6b362b7e-a210-4d52-93b4-541731f57de8" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:35:34 GMT" - ], - "Server": [ - "Microsoft-IIS/8.5" - ], - "X-Powered-By": [ - "ASP.NET" - ] - }, - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourceGroups/pstestrg2645/providers/microsoft.insights/components/apppstestrg2645?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjY0NS9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNjQ1P2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "8dd0ad54-c368-4adf-99b8-75372c18c6ad" - ], - "accept-language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.7.2110.0", - "OSName/Windows10Enterprise", - "OSVersion/6.3.15063", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.1.0.1" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "8dd0ad54-c368-4adf-99b8-75372c18c6ad" - ], - "x-content-type-options": [ - "nosniff", - "nosniff" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "b70dd365-b7f4-492a-a486-6c8075680e59" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T203537Z:b70dd365-b7f4-492a-a486-6c8075680e59" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:35:37 GMT" - ], - "Server": [ - "Microsoft-IIS/8.5" - ], - "X-Powered-By": [ - "ASP.NET" - ] - }, - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/resourcegroups/pstestrg2645?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjY0NT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1196" - ], - "x-ms-request-id": [ - "658b0a01-f834-411b-be90-c55649fb27f7" - ], - "x-ms-correlation-request-id": [ - "658b0a01-f834-411b-be90-c55649fb27f7" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T203539Z:658b0a01-f834-411b-be90-c55649fb27f7" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:35:38 GMT" - ], - "Location": [ - "https://management.azure.com/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI2NDUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" - ] - }, - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI2NDUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkyTkRVdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-version": [ - "2016-02-01" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14962" - ], - "x-ms-request-id": [ - "fffcd9da-a4c4-4e3e-9682-540e0eeed18b" - ], - "x-ms-correlation-request-id": [ - "fffcd9da-a4c4-4e3e-9682-540e0eeed18b" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T203539Z:fffcd9da-a4c4-4e3e-9682-540e0eeed18b" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:35:38 GMT" - ], - "Location": [ - "https://management.azure.com/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI2NDUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" - ] - }, - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI2NDUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkyTkRVdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-version": [ - "2016-02-01" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14961" - ], - "x-ms-request-id": [ - "ae0f9855-b189-4f59-a64e-edb23029ad39" - ], - "x-ms-correlation-request-id": [ - "ae0f9855-b189-4f59-a64e-edb23029ad39" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T203554Z:ae0f9855-b189-4f59-a64e-edb23029ad39" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:35:54 GMT" - ], - "Location": [ - "https://management.azure.com/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI2NDUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01" - ] - }, - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/b90b0dec-9b9a-4778-a84e-4ffb73bb17f6/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI2NDUtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjkwYjBkZWMtOWI5YS00Nzc4LWE4NGUtNGZmYjczYmIxN2Y2L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkyTkRVdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-version": [ - "2016-02-01" - ], - "User-Agent": [ - "Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0" - ] - }, - "ResponseBody": "", - "ResponseHeaders": { - "Content-Length": [ - "0" - ], - "Expires": [ - "-1" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "14960" - ], - "x-ms-request-id": [ - "78627eca-747f-43c5-b98d-086a5bbfe9ab" - ], - "x-ms-correlation-request-id": [ - "78627eca-747f-43c5-b98d-086a5bbfe9ab" - ], - "x-ms-routing-request-id": [ - "WESTUS:20171006T203610Z:78627eca-747f-43c5-b98d-086a5bbfe9ab" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Cache-Control": [ - "no-cache" - ], - "Date": [ - "Fri, 06 Oct 2017 20:36:09 GMT" - ] - }, - "StatusCode": 200 - } - ], - "Names": { - "Test-RemoveApplicationInsights": [ - "pstestrg2645" - ] - }, - "Variables": { - "SubscriptionId": "b90b0dec-9b9a-4778-a84e-4ffb73bb17f6" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestGetContinuousExport.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestGetContinuousExport.json deleted file mode 100644 index c057aafaefdb..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestGetContinuousExport.json +++ /dev/null @@ -1,801 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg2103?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjEwMz9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "5eb5d31c-388a-42d6-9adb-861e9e568620" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-request-id": [ - "8de93bf2-0667-43b3-8601-6bbfbaa989cd" - ], - "x-ms-correlation-request-id": [ - "8de93bf2-0667-43b3-8601-6bbfbaa989cd" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093511Z:8de93bf2-0667-43b3-8601-6bbfbaa989cd" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:35:11 GMT" - ], - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2103\",\r\n \"name\": \"pstestrg2103\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2103/providers/Microsoft.Insights/components/apppstestrg2103?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjEwMy9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyMTAzP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "90565d01-f684-4bd3-b942-b78efd02d95b" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "6bc90cbe-2152-4ba8-8ab7-34e9490ba48d" - ], - "x-ms-correlation-request-id": [ - "6bc90cbe-2152-4ba8-8ab7-34e9490ba48d" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093512Z:6bc90cbe-2152-4ba8-8ab7-34e9490ba48d" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:35:12 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "161" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg2103' under resource group 'pstestrg2103' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2103/providers/Microsoft.Insights/components/apppstestrg2103?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjEwMy9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyMTAzP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "32437735-4ba7-4550-89f9-1c9f48547813" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "32437735-4ba7-4550-89f9-1c9f48547813" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "fb779c7c-fbf6-4c5b-93be-79dcc3ab9c62" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093523Z:fb779c7c-fbf6-4c5b-93be-79dcc3ab9c62" - ], - "Date": [ - "Sat, 02 May 2020 09:35:23 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2103/providers/microsoft.insights/components/apppstestrg2103\",\r\n \"name\": \"apppstestrg2103\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"090013c0-0000-0100-0000-5ead3ed80000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg2103\",\r\n \"AppId\": \"d8aa0117-fd16-4e62-b311-270a8b6e1ffd\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"8dce82ca-5250-48ba-ba8e-cef72db47ed5\",\r\n \"ConnectionString\": \"InstrumentationKey=8dce82ca-5250-48ba-ba8e-cef72db47ed5\",\r\n \"Name\": \"apppstestrg2103\",\r\n \"CreationDate\": \"2020-05-02T17:35:20.7196368+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2103/providers/Microsoft.Insights/components/apppstestrg2103/exportconfiguration?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjEwMy9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyMTAzL2V4cG9ydGNvbmZpZ3VyYXRpb24/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"RecordTypes\": \"Requests,Event\",\r\n \"DestinationType\": \"Blob\",\r\n \"DestinationAddress\": \"https://dummysa.blob.core.windows.net/dummycontianer?sv=2015-04-05&sr=c&sig=xxxxxxxxx&sp=w\",\r\n \"IsEnabled\": \"true\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg2103/providers/Microsoft.Storage/storageAccounts/dummysa\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "d6a208eb-591b-4b33-b381-1d114e1d1782" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "498" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "d6a208eb-591b-4b33-b381-1d114e1d1782" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "ade46a71-121c-464f-8d5e-d210c63acd63" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093524Z:ade46a71-121c-464f-8d5e-d210c63acd63" - ], - "Date": [ - "Sat, 02 May 2020 09:35:24 GMT" - ], - "Content-Length": [ - "912" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "[\r\n {\r\n \"ExportId\": \"OPxM582s76Vnf1BXOOimQQtGSdg=\",\r\n \"InstrumentationKey\": \"8dce82ca-5250-48ba-ba8e-cef72db47ed5\",\r\n \"RecordTypes\": \"Requests, Event\",\r\n \"ApplicationName\": \"apppstestrg2103\",\r\n \"SubscriptionId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"ResourceGroup\": \"pstestrg2103\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg2103/providers/Microsoft.Storage/storageAccounts/dummysa\",\r\n \"DestinationType\": \"Blob\",\r\n \"IsUserEnabled\": \"True\",\r\n \"LastUserUpdate\": \"2020-05-02T09:35:24.6076065Z\",\r\n \"NotificationQueueEnabled\": \"False\",\r\n \"DestinationKustoCluster\": null,\r\n \"DestinationKustoDatabase\": null,\r\n \"TransformationType\": \"Default\",\r\n \"ExportStatus\": \"Preparing\",\r\n \"LastSuccessTime\": null,\r\n \"LastGapTime\": null,\r\n \"PermanentErrorReason\": \"None\",\r\n \"StorageName\": \"dummysa\",\r\n \"ContainerName\": \"dummycontianer\"\r\n }\r\n]", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2103/providers/Microsoft.Insights/components/apppstestrg2103/exportconfiguration/OPxM582s76Vnf1BXOOimQQtGSdg%3D?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjEwMy9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyMTAzL2V4cG9ydGNvbmZpZ3VyYXRpb24vT1B4TTU4MnM3NlZuZjFCWE9PaW1RUXRHU2RnJTNEP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "f3d043fa-6e90-464b-bbd3-2954796a7729" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "f3d043fa-6e90-464b-bbd3-2954796a7729" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-export-configuration-count": [ - "1" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11992" - ], - "x-ms-correlation-request-id": [ - "3ddc74d9-2ad8-42a0-9dec-3368922120a6" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093525Z:3ddc74d9-2ad8-42a0-9dec-3368922120a6" - ], - "Date": [ - "Sat, 02 May 2020 09:35:24 GMT" - ], - "Content-Length": [ - "910" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"ExportId\": \"OPxM582s76Vnf1BXOOimQQtGSdg=\",\r\n \"InstrumentationKey\": \"8dce82ca-5250-48ba-ba8e-cef72db47ed5\",\r\n \"RecordTypes\": \"Requests, Event\",\r\n \"ApplicationName\": \"apppstestrg2103\",\r\n \"SubscriptionId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"ResourceGroup\": \"pstestrg2103\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg2103/providers/Microsoft.Storage/storageAccounts/dummysa\",\r\n \"DestinationType\": \"Blob\",\r\n \"IsUserEnabled\": \"True\",\r\n \"LastUserUpdate\": \"2020-05-02T09:35:24.6076065Z\",\r\n \"NotificationQueueEnabled\": \"False\",\r\n \"DestinationKustoCluster\": null,\r\n \"DestinationKustoDatabase\": null,\r\n \"TransformationType\": \"Default\",\r\n \"ExportStatus\": \"Preparing\",\r\n \"LastSuccessTime\": null,\r\n \"LastGapTime\": null,\r\n \"PermanentErrorReason\": \"None\",\r\n \"StorageName\": \"dummysa\",\r\n \"ContainerName\": \"dummycontianer\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2103/providers/Microsoft.Insights/components/apppstestrg2103/exportconfiguration?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjEwMy9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyMTAzL2V4cG9ydGNvbmZpZ3VyYXRpb24/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "6436ae52-4ec0-4adc-9b4c-621d3f6c5349" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "6436ae52-4ec0-4adc-9b4c-621d3f6c5349" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-export-configuration-count": [ - "1" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11991" - ], - "x-ms-correlation-request-id": [ - "cf2c70a7-0247-4abc-92bd-42b396b560db" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093525Z:cf2c70a7-0247-4abc-92bd-42b396b560db" - ], - "Date": [ - "Sat, 02 May 2020 09:35:25 GMT" - ], - "Content-Length": [ - "912" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "[\r\n {\r\n \"ExportId\": \"OPxM582s76Vnf1BXOOimQQtGSdg=\",\r\n \"InstrumentationKey\": \"8dce82ca-5250-48ba-ba8e-cef72db47ed5\",\r\n \"RecordTypes\": \"Requests, Event\",\r\n \"ApplicationName\": \"apppstestrg2103\",\r\n \"SubscriptionId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"ResourceGroup\": \"pstestrg2103\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg2103/providers/Microsoft.Storage/storageAccounts/dummysa\",\r\n \"DestinationType\": \"Blob\",\r\n \"IsUserEnabled\": \"True\",\r\n \"LastUserUpdate\": \"2020-05-02T09:35:24.6076065Z\",\r\n \"NotificationQueueEnabled\": \"False\",\r\n \"DestinationKustoCluster\": null,\r\n \"DestinationKustoDatabase\": null,\r\n \"TransformationType\": \"Default\",\r\n \"ExportStatus\": \"Preparing\",\r\n \"LastSuccessTime\": null,\r\n \"LastGapTime\": null,\r\n \"PermanentErrorReason\": \"None\",\r\n \"StorageName\": \"dummysa\",\r\n \"ContainerName\": \"dummycontianer\"\r\n }\r\n]", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2103/providers/Microsoft.Insights/components/apppstestrg2103?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjEwMy9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyMTAzP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "79656fba-9a77-4669-8b68-6b18ed59e022" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "79656fba-9a77-4669-8b68-6b18ed59e022" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-correlation-request-id": [ - "5afc6188-fe59-425b-a210-a545bb3a38d6" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093529Z:5afc6188-fe59-425b-a210-a545bb3a38d6" - ], - "Date": [ - "Sat, 02 May 2020 09:35:29 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg2103?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjEwMz9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "98a3bc5e-deab-4aba-a1a5-0fcdabf6d025" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzIxMDMtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-request-id": [ - "869286d8-ac85-4e63-a83c-f96ee3c638b2" - ], - "x-ms-correlation-request-id": [ - "869286d8-ac85-4e63-a83c-f96ee3c638b2" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093534Z:869286d8-ac85-4e63-a83c-f96ee3c638b2" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:35:34 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzIxMDMtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekl4TURNdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzIxMDMtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" - ], - "x-ms-request-id": [ - "865b68cd-5208-4cfc-a601-192132743cf9" - ], - "x-ms-correlation-request-id": [ - "865b68cd-5208-4cfc-a601-192132743cf9" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093550Z:865b68cd-5208-4cfc-a601-192132743cf9" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:35:49 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzIxMDMtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekl4TURNdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzIxMDMtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-request-id": [ - "0610fa6f-0bce-41e9-b8c7-54af8b1d4089" - ], - "x-ms-correlation-request-id": [ - "0610fa6f-0bce-41e9-b8c7-54af8b1d4089" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093606Z:0610fa6f-0bce-41e9-b8c7-54af8b1d4089" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:36:05 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzIxMDMtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekl4TURNdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-request-id": [ - "d5028b65-664f-442b-a4fd-81b43fe8946b" - ], - "x-ms-correlation-request-id": [ - "d5028b65-664f-442b-a4fd-81b43fe8946b" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093621Z:d5028b65-664f-442b-a4fd-81b43fe8946b" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:36:21 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzIxMDMtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekl4TURNdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-request-id": [ - "f5029b5d-3750-4225-be39-c0adf81fe20a" - ], - "x-ms-correlation-request-id": [ - "f5029b5d-3750-4225-be39-c0adf81fe20a" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093622Z:f5029b5d-3750-4225-be39-c0adf81fe20a" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:36:21 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-GetApplicationInsightsContinuousExport": [ - "pstestrg2103" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestNewContinuousExport.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestNewContinuousExport.json deleted file mode 100644 index 79712de86430..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestNewContinuousExport.json +++ /dev/null @@ -1,723 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg3204?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMzIwND9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "61d0e96c-9050-4b17-b150-3ea2fe39f2c6" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-request-id": [ - "3a1b8a0c-c646-45fc-93ea-9fbbde5909bf" - ], - "x-ms-correlation-request-id": [ - "3a1b8a0c-c646-45fc-93ea-9fbbde5909bf" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093757Z:3a1b8a0c-c646-45fc-93ea-9fbbde5909bf" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:37:57 GMT" - ], - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3204\",\r\n \"name\": \"pstestrg3204\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3204/providers/Microsoft.Insights/components/apppstestrg3204?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzIwNC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczMjA0P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "8fc512a8-b64c-4481-af03-2a953fd7cc73" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "cee0256f-aee0-4c28-a6a9-d077f3cda19b" - ], - "x-ms-correlation-request-id": [ - "cee0256f-aee0-4c28-a6a9-d077f3cda19b" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093758Z:cee0256f-aee0-4c28-a6a9-d077f3cda19b" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:37:58 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "161" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg3204' under resource group 'pstestrg3204' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3204/providers/Microsoft.Insights/components/apppstestrg3204?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzIwNC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczMjA0P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "4afc0e49-220e-445d-bcab-431fc9eb0454" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "4afc0e49-220e-445d-bcab-431fc9eb0454" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "78ed140e-2756-4abe-a233-589998c94950" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093809Z:78ed140e-2756-4abe-a233-589998c94950" - ], - "Date": [ - "Sat, 02 May 2020 09:38:09 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3204/providers/microsoft.insights/components/apppstestrg3204\",\r\n \"name\": \"apppstestrg3204\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"0900d9c0-0000-0100-0000-5ead3f7c0000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg3204\",\r\n \"AppId\": \"370791e8-f2cb-481f-9ac6-45043bba710b\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"359b045f-d7ce-4665-887d-13525d4e8739\",\r\n \"ConnectionString\": \"InstrumentationKey=359b045f-d7ce-4665-887d-13525d4e8739\",\r\n \"Name\": \"apppstestrg3204\",\r\n \"CreationDate\": \"2020-05-02T17:38:04.8742303+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3204/providers/Microsoft.Insights/components/apppstestrg3204/exportconfiguration?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzIwNC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczMjA0L2V4cG9ydGNvbmZpZ3VyYXRpb24/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"RecordTypes\": \"Requests,Event\",\r\n \"DestinationType\": \"Blob\",\r\n \"DestinationAddress\": \"https://dummysa.blob.core.windows.net/dummycontianer?sv=2015-04-05&sr=c&sig=xxxxxxxxx&sp=w\",\r\n \"IsEnabled\": \"true\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg3204/providers/Microsoft.Storage/storageAccounts/dummysa\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "4fcf07f0-7ca7-4f61-9324-f8fbf2535f3f" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "498" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "4fcf07f0-7ca7-4f61-9324-f8fbf2535f3f" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "cf87baa4-68ff-49af-9908-baacf668d1d2" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093810Z:cf87baa4-68ff-49af-9908-baacf668d1d2" - ], - "Date": [ - "Sat, 02 May 2020 09:38:10 GMT" - ], - "Content-Length": [ - "912" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "[\r\n {\r\n \"ExportId\": \"yy4jJVGpB3rxbnjyVliygHhRH7o=\",\r\n \"InstrumentationKey\": \"359b045f-d7ce-4665-887d-13525d4e8739\",\r\n \"RecordTypes\": \"Requests, Event\",\r\n \"ApplicationName\": \"apppstestrg3204\",\r\n \"SubscriptionId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"ResourceGroup\": \"pstestrg3204\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg3204/providers/Microsoft.Storage/storageAccounts/dummysa\",\r\n \"DestinationType\": \"Blob\",\r\n \"IsUserEnabled\": \"True\",\r\n \"LastUserUpdate\": \"2020-05-02T09:38:10.4855384Z\",\r\n \"NotificationQueueEnabled\": \"False\",\r\n \"DestinationKustoCluster\": null,\r\n \"DestinationKustoDatabase\": null,\r\n \"TransformationType\": \"Default\",\r\n \"ExportStatus\": \"Preparing\",\r\n \"LastSuccessTime\": null,\r\n \"LastGapTime\": null,\r\n \"PermanentErrorReason\": \"None\",\r\n \"StorageName\": \"dummysa\",\r\n \"ContainerName\": \"dummycontianer\"\r\n }\r\n]", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3204/providers/Microsoft.Insights/components/apppstestrg3204/exportconfiguration/yy4jJVGpB3rxbnjyVliygHhRH7o%3D?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzIwNC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczMjA0L2V4cG9ydGNvbmZpZ3VyYXRpb24veXk0akpWR3BCM3J4Ym5qeVZsaXlnSGhSSDdvJTNEP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "b8c925e6-4865-4665-899b-3bf7d44bd990" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "b8c925e6-4865-4665-899b-3bf7d44bd990" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-export-configuration-count": [ - "1" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-correlation-request-id": [ - "21fee244-0e0e-491c-921d-7e6ca94b9be7" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093811Z:21fee244-0e0e-491c-921d-7e6ca94b9be7" - ], - "Date": [ - "Sat, 02 May 2020 09:38:10 GMT" - ], - "Content-Length": [ - "910" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"ExportId\": \"yy4jJVGpB3rxbnjyVliygHhRH7o=\",\r\n \"InstrumentationKey\": \"359b045f-d7ce-4665-887d-13525d4e8739\",\r\n \"RecordTypes\": \"Requests, Event\",\r\n \"ApplicationName\": \"apppstestrg3204\",\r\n \"SubscriptionId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"ResourceGroup\": \"pstestrg3204\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg3204/providers/Microsoft.Storage/storageAccounts/dummysa\",\r\n \"DestinationType\": \"Blob\",\r\n \"IsUserEnabled\": \"True\",\r\n \"LastUserUpdate\": \"2020-05-02T09:38:10.4855384Z\",\r\n \"NotificationQueueEnabled\": \"False\",\r\n \"DestinationKustoCluster\": null,\r\n \"DestinationKustoDatabase\": null,\r\n \"TransformationType\": \"Default\",\r\n \"ExportStatus\": \"Preparing\",\r\n \"LastSuccessTime\": null,\r\n \"LastGapTime\": null,\r\n \"PermanentErrorReason\": \"None\",\r\n \"StorageName\": \"dummysa\",\r\n \"ContainerName\": \"dummycontianer\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3204/providers/Microsoft.Insights/components/apppstestrg3204?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzIwNC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczMjA0P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "6d44a98b-cef5-4e82-aca9-31df5061f6c9" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "6d44a98b-cef5-4e82-aca9-31df5061f6c9" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-correlation-request-id": [ - "6b673b3a-327e-486b-82a4-528e8f17f805" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093815Z:6b673b3a-327e-486b-82a4-528e8f17f805" - ], - "Date": [ - "Sat, 02 May 2020 09:38:14 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg3204?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMzIwND9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "c038396b-b0c1-4946-8ee3-ba06c814f40a" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMyMDQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14997" - ], - "x-ms-request-id": [ - "7ee8d6d6-74e6-4699-a1ae-47987c7a573e" - ], - "x-ms-correlation-request-id": [ - "7ee8d6d6-74e6-4699-a1ae-47987c7a573e" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093818Z:7ee8d6d6-74e6-4699-a1ae-47987c7a573e" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:38:17 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMyMDQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek15TURRdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMyMDQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11995" - ], - "x-ms-request-id": [ - "9977a26f-a191-4444-bb3d-3d8b98c12a5c" - ], - "x-ms-correlation-request-id": [ - "9977a26f-a191-4444-bb3d-3d8b98c12a5c" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093834Z:9977a26f-a191-4444-bb3d-3d8b98c12a5c" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:38:34 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMyMDQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek15TURRdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMyMDQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-request-id": [ - "217c23ca-a5d6-4bea-a6a2-1d6fa778dbf9" - ], - "x-ms-correlation-request-id": [ - "217c23ca-a5d6-4bea-a6a2-1d6fa778dbf9" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093849Z:217c23ca-a5d6-4bea-a6a2-1d6fa778dbf9" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:38:49 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMyMDQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek15TURRdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" - ], - "x-ms-request-id": [ - "6877df78-a2d9-42dd-bff6-acdc2638ea50" - ], - "x-ms-correlation-request-id": [ - "6877df78-a2d9-42dd-bff6-acdc2638ea50" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093905Z:6877df78-a2d9-42dd-bff6-acdc2638ea50" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:39:04 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzMyMDQtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek15TURRdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11992" - ], - "x-ms-request-id": [ - "8931dfd5-6d43-4e4d-bbff-f2fbe5f8082f" - ], - "x-ms-correlation-request-id": [ - "8931dfd5-6d43-4e4d-bbff-f2fbe5f8082f" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093905Z:8931dfd5-6d43-4e4d-bbff-f2fbe5f8082f" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:39:04 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-NewApplicationInsightsContinuousExport": [ - "pstestrg3204" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestRemoveContinuousExport.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestRemoveContinuousExport.json deleted file mode 100644 index 4e564f965f09..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestRemoveContinuousExport.json +++ /dev/null @@ -1,876 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg2736?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjczNj9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "cfa05533-b674-410f-aa57-833d66e29cbf" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-request-id": [ - "bcdb3d4a-7c47-42b5-b589-bed885705362" - ], - "x-ms-correlation-request-id": [ - "bcdb3d4a-7c47-42b5-b589-bed885705362" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093917Z:bcdb3d4a-7c47-42b5-b589-bed885705362" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:39:17 GMT" - ], - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2736\",\r\n \"name\": \"pstestrg2736\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2736/providers/Microsoft.Insights/components/apppstestrg2736?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjczNi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNzM2P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "c73b4db3-f9b2-4995-b20d-11ea15a7ebbe" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "4f7cd3bc-6a17-4447-9c07-b6b86e903c8f" - ], - "x-ms-correlation-request-id": [ - "4f7cd3bc-6a17-4447-9c07-b6b86e903c8f" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093918Z:4f7cd3bc-6a17-4447-9c07-b6b86e903c8f" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:39:17 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "161" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg2736' under resource group 'pstestrg2736' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2736/providers/Microsoft.Insights/components/apppstestrg2736?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjczNi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNzM2P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "c153e1cf-91d1-4b4e-84af-d8f60d4acf69" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "c153e1cf-91d1-4b4e-84af-d8f60d4acf69" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "a987e76a-59f1-4fd6-9ab8-af1e0a9a2eec" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093928Z:a987e76a-59f1-4fd6-9ab8-af1e0a9a2eec" - ], - "Date": [ - "Sat, 02 May 2020 09:39:28 GMT" - ], - "Content-Length": [ - "889" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2736/providers/microsoft.insights/components/apppstestrg2736\",\r\n \"name\": \"apppstestrg2736\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"090053c1-0000-0100-0000-5ead3fcd0000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg2736\",\r\n \"AppId\": \"96c4c012-517f-4fc4-84e4-5d91dd349f68\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"84beba11-a446-46b4-b74b-0b695d3e8e21\",\r\n \"ConnectionString\": \"InstrumentationKey=84beba11-a446-46b4-b74b-0b695d3e8e21\",\r\n \"Name\": \"apppstestrg2736\",\r\n \"CreationDate\": \"2020-05-02T17:39:25.719236+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2736/providers/Microsoft.Insights/components/apppstestrg2736/exportconfiguration?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjczNi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNzM2L2V4cG9ydGNvbmZpZ3VyYXRpb24/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"RecordTypes\": \"Requests,Event\",\r\n \"DestinationType\": \"Blob\",\r\n \"DestinationAddress\": \"https://dummysa.blob.core.windows.net/dummycontianer?sv=2015-04-05&sr=c&sig=xxxxxxxxx&sp=w\",\r\n \"IsEnabled\": \"true\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg2736/providers/Microsoft.Storage/storageAccounts/dummysa\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "16f6c2b6-f127-4094-9e12-9c972c6211e0" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "498" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "16f6c2b6-f127-4094-9e12-9c972c6211e0" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "41241c74-f9e8-4212-a582-2da1609eb1fb" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093929Z:41241c74-f9e8-4212-a582-2da1609eb1fb" - ], - "Date": [ - "Sat, 02 May 2020 09:39:29 GMT" - ], - "Content-Length": [ - "911" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "[\r\n {\r\n \"ExportId\": \"XnHmJOpduVcK8HrgaJOvmTbmHQ=\",\r\n \"InstrumentationKey\": \"84beba11-a446-46b4-b74b-0b695d3e8e21\",\r\n \"RecordTypes\": \"Requests, Event\",\r\n \"ApplicationName\": \"apppstestrg2736\",\r\n \"SubscriptionId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"ResourceGroup\": \"pstestrg2736\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg2736/providers/Microsoft.Storage/storageAccounts/dummysa\",\r\n \"DestinationType\": \"Blob\",\r\n \"IsUserEnabled\": \"True\",\r\n \"LastUserUpdate\": \"2020-05-02T09:39:29.6539151Z\",\r\n \"NotificationQueueEnabled\": \"False\",\r\n \"DestinationKustoCluster\": null,\r\n \"DestinationKustoDatabase\": null,\r\n \"TransformationType\": \"Default\",\r\n \"ExportStatus\": \"Preparing\",\r\n \"LastSuccessTime\": null,\r\n \"LastGapTime\": null,\r\n \"PermanentErrorReason\": \"None\",\r\n \"StorageName\": \"dummysa\",\r\n \"ContainerName\": \"dummycontianer\"\r\n }\r\n]", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2736/providers/Microsoft.Insights/components/apppstestrg2736/exportconfiguration/XnHmJOpduVcK8HrgaJOvmTbmHQ%3D?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjczNi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNzM2L2V4cG9ydGNvbmZpZ3VyYXRpb24vWG5IbUpPcGR1VmNLOEhyZ2FKT3ZtVGJtSFElM0Q/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "7119dc47-c361-4a99-ae52-5cbfcf38df54" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "7119dc47-c361-4a99-ae52-5cbfcf38df54" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-export-configuration-count": [ - "1" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-correlation-request-id": [ - "7edcd8f5-db98-416c-bc7b-f5e820cff279" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093930Z:7edcd8f5-db98-416c-bc7b-f5e820cff279" - ], - "Date": [ - "Sat, 02 May 2020 09:39:30 GMT" - ], - "Content-Length": [ - "909" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"ExportId\": \"XnHmJOpduVcK8HrgaJOvmTbmHQ=\",\r\n \"InstrumentationKey\": \"84beba11-a446-46b4-b74b-0b695d3e8e21\",\r\n \"RecordTypes\": \"Requests, Event\",\r\n \"ApplicationName\": \"apppstestrg2736\",\r\n \"SubscriptionId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"ResourceGroup\": \"pstestrg2736\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg2736/providers/Microsoft.Storage/storageAccounts/dummysa\",\r\n \"DestinationType\": \"Blob\",\r\n \"IsUserEnabled\": \"True\",\r\n \"LastUserUpdate\": \"2020-05-02T09:39:29.6539151Z\",\r\n \"NotificationQueueEnabled\": \"False\",\r\n \"DestinationKustoCluster\": null,\r\n \"DestinationKustoDatabase\": null,\r\n \"TransformationType\": \"Default\",\r\n \"ExportStatus\": \"Preparing\",\r\n \"LastSuccessTime\": null,\r\n \"LastGapTime\": null,\r\n \"PermanentErrorReason\": \"None\",\r\n \"StorageName\": \"dummysa\",\r\n \"ContainerName\": \"dummycontianer\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2736/providers/Microsoft.Insights/components/apppstestrg2736/exportconfiguration/XnHmJOpduVcK8HrgaJOvmTbmHQ%3D?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjczNi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNzM2L2V4cG9ydGNvbmZpZ3VyYXRpb24vWG5IbUpPcGR1VmNLOEhyZ2FKT3ZtVGJtSFElM0Q/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "bd282949-269b-4274-8184-410cbdf50538" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "bd282949-269b-4274-8184-410cbdf50538" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-correlation-request-id": [ - "0097d49d-d6df-4dce-aff4-f73c983948be" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093930Z:0097d49d-d6df-4dce-aff4-f73c983948be" - ], - "Date": [ - "Sat, 02 May 2020 09:39:30 GMT" - ], - "Content-Length": [ - "909" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"ExportId\": \"XnHmJOpduVcK8HrgaJOvmTbmHQ=\",\r\n \"InstrumentationKey\": \"84beba11-a446-46b4-b74b-0b695d3e8e21\",\r\n \"RecordTypes\": \"Requests, Event\",\r\n \"ApplicationName\": \"apppstestrg2736\",\r\n \"SubscriptionId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"ResourceGroup\": \"pstestrg2736\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg2736/providers/Microsoft.Storage/storageAccounts/dummysa\",\r\n \"DestinationType\": \"Blob\",\r\n \"IsUserEnabled\": \"True\",\r\n \"LastUserUpdate\": \"2020-05-02T09:39:29.6539151Z\",\r\n \"NotificationQueueEnabled\": \"False\",\r\n \"DestinationKustoCluster\": null,\r\n \"DestinationKustoDatabase\": null,\r\n \"TransformationType\": \"Default\",\r\n \"ExportStatus\": \"Preparing\",\r\n \"LastSuccessTime\": null,\r\n \"LastGapTime\": null,\r\n \"PermanentErrorReason\": \"None\",\r\n \"StorageName\": \"dummysa\",\r\n \"ContainerName\": \"dummycontianer\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2736/providers/Microsoft.Insights/components/apppstestrg2736/exportconfiguration?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjczNi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNzM2L2V4cG9ydGNvbmZpZ3VyYXRpb24/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "751049ce-971b-4bed-ba16-824263d10ef1" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "751049ce-971b-4bed-ba16-824263d10ef1" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-export-configuration-count": [ - "0" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-correlation-request-id": [ - "c25d5287-85d5-4e54-b6d5-c7abbd057077" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093931Z:c25d5287-85d5-4e54-b6d5-c7abbd057077" - ], - "Date": [ - "Sat, 02 May 2020 09:39:31 GMT" - ], - "Content-Length": [ - "2" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "[]", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2736/providers/Microsoft.Insights/components/apppstestrg2736?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjczNi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNzM2P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "a698d6cc-1fc9-4ff1-83c4-bfd8aca6f7dc" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "a698d6cc-1fc9-4ff1-83c4-bfd8aca6f7dc" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-correlation-request-id": [ - "923edb42-087f-4a30-94b0-b147aaf4ae93" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200502T093935Z:923edb42-087f-4a30-94b0-b147aaf4ae93" - ], - "Date": [ - "Sat, 02 May 2020 09:39:35 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg2736?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjczNj9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "407f97ac-7930-4657-8850-458ae1d4373b" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI3MzYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-request-id": [ - "56685080-4035-4735-9605-d5fd3d991f8d" - ], - "x-ms-correlation-request-id": [ - "56685080-4035-4735-9605-d5fd3d991f8d" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093939Z:56685080-4035-4735-9605-d5fd3d991f8d" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:39:39 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI3MzYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkzTXpZdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI3MzYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" - ], - "x-ms-request-id": [ - "7f0f9cb7-9fd8-48a9-9815-59149acd4f5a" - ], - "x-ms-correlation-request-id": [ - "7f0f9cb7-9fd8-48a9-9815-59149acd4f5a" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093955Z:7f0f9cb7-9fd8-48a9-9815-59149acd4f5a" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:39:54 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI3MzYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkzTXpZdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI3MzYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-request-id": [ - "8d792bac-aaa6-4781-8770-6e4da1b31758" - ], - "x-ms-correlation-request-id": [ - "8d792bac-aaa6-4781-8770-6e4da1b31758" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T094010Z:8d792bac-aaa6-4781-8770-6e4da1b31758" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:40:10 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI3MzYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkzTXpZdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-request-id": [ - "ea71af43-5f8b-4d5d-afda-e26f7f3ca734" - ], - "x-ms-correlation-request-id": [ - "ea71af43-5f8b-4d5d-afda-e26f7f3ca734" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T094026Z:ea71af43-5f8b-4d5d-afda-e26f7f3ca734" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:40:25 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI3MzYtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkzTXpZdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-request-id": [ - "4453b97d-92ca-47d6-b020-5e55f54e4e61" - ], - "x-ms-correlation-request-id": [ - "4453b97d-92ca-47d6-b020-5e55f54e4e61" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T094026Z:4453b97d-92ca-47d6-b020-5e55f54e4e61" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:40:26 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-RemoveApplicationInsightsContinuousExport": [ - "pstestrg2736" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestSetContinuousExport.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestSetContinuousExport.json deleted file mode 100644 index ff012adbbef6..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.ContinuousExportTests/TestSetContinuousExport.json +++ /dev/null @@ -1,804 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg6310?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnNjMxMD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "08b060bb-2df4-4480-904f-e03d99d7dba6" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-request-id": [ - "97bc513b-c1f8-4728-b94b-bc04bdc9aab0" - ], - "x-ms-correlation-request-id": [ - "97bc513b-c1f8-4728-b94b-bc04bdc9aab0" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093632Z:97bc513b-c1f8-4728-b94b-bc04bdc9aab0" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:36:31 GMT" - ], - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg6310\",\r\n \"name\": \"pstestrg6310\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg6310/providers/Microsoft.Insights/components/apppstestrg6310?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjMxMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc2MzEwP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "36a61c9d-3944-49e5-8293-4f91a3379680" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "a5bc8981-ce7a-4533-b56a-f283fe72e03a" - ], - "x-ms-correlation-request-id": [ - "a5bc8981-ce7a-4533-b56a-f283fe72e03a" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093633Z:a5bc8981-ce7a-4533-b56a-f283fe72e03a" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:36:32 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "161" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg6310' under resource group 'pstestrg6310' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg6310/providers/Microsoft.Insights/components/apppstestrg6310?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjMxMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc2MzEwP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "cf3c8fb4-bb8b-4d8f-b784-d0f8e88584c6" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "cf3c8fb4-bb8b-4d8f-b784-d0f8e88584c6" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "0018cc1c-bc4f-4c67-9a82-43e3b0636773" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093645Z:0018cc1c-bc4f-4c67-9a82-43e3b0636773" - ], - "Date": [ - "Sat, 02 May 2020 09:36:44 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg6310/providers/microsoft.insights/components/apppstestrg6310\",\r\n \"name\": \"apppstestrg6310\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"090051c0-0000-0100-0000-5ead3f290000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg6310\",\r\n \"AppId\": \"9582aefe-a20b-447b-94a7-32a0fe559c59\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"52671e8e-c7d0-45ad-8dac-506faa0ac74e\",\r\n \"ConnectionString\": \"InstrumentationKey=52671e8e-c7d0-45ad-8dac-506faa0ac74e\",\r\n \"Name\": \"apppstestrg6310\",\r\n \"CreationDate\": \"2020-05-02T17:36:41.0917213+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg6310/providers/Microsoft.Insights/components/apppstestrg6310/exportconfiguration?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjMxMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc2MzEwL2V4cG9ydGNvbmZpZ3VyYXRpb24/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"RecordTypes\": \"Requests,Event\",\r\n \"DestinationType\": \"Blob\",\r\n \"DestinationAddress\": \"https://dummysa.blob.core.windows.net/dummycontianer?sv=2015-04-05&sr=c&sig=xxxxxxxxx&sp=w\",\r\n \"IsEnabled\": \"true\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg6310/providers/Microsoft.Storage/storageAccounts/dummysa\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "c31ce5a6-8bdd-4d8b-9424-1a5d34d43f7e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "498" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "c31ce5a6-8bdd-4d8b-9424-1a5d34d43f7e" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "707da06b-1981-4c34-9130-e6615c09d8fa" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093646Z:707da06b-1981-4c34-9130-e6615c09d8fa" - ], - "Date": [ - "Sat, 02 May 2020 09:36:45 GMT" - ], - "Content-Length": [ - "911" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "[\r\n {\r\n \"ExportId\": \"HVTIk5pJGzYqAe10rHb2McBj5Q=\",\r\n \"InstrumentationKey\": \"52671e8e-c7d0-45ad-8dac-506faa0ac74e\",\r\n \"RecordTypes\": \"Requests, Event\",\r\n \"ApplicationName\": \"apppstestrg6310\",\r\n \"SubscriptionId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"ResourceGroup\": \"pstestrg6310\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg6310/providers/Microsoft.Storage/storageAccounts/dummysa\",\r\n \"DestinationType\": \"Blob\",\r\n \"IsUserEnabled\": \"True\",\r\n \"LastUserUpdate\": \"2020-05-02T09:36:46.5443765Z\",\r\n \"NotificationQueueEnabled\": \"False\",\r\n \"DestinationKustoCluster\": null,\r\n \"DestinationKustoDatabase\": null,\r\n \"TransformationType\": \"Default\",\r\n \"ExportStatus\": \"Preparing\",\r\n \"LastSuccessTime\": null,\r\n \"LastGapTime\": null,\r\n \"PermanentErrorReason\": \"None\",\r\n \"StorageName\": \"dummysa\",\r\n \"ContainerName\": \"dummycontianer\"\r\n }\r\n]", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg6310/providers/Microsoft.Insights/components/apppstestrg6310/exportconfiguration/HVTIk5pJGzYqAe10rHb2McBj5Q%3D?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjMxMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc2MzEwL2V4cG9ydGNvbmZpZ3VyYXRpb24vSFZUSWs1cEpHellxQWUxMHJIYjJNY0JqNVElM0Q/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "604e94a1-8f77-4d33-a60c-fa0c30bbf760" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "604e94a1-8f77-4d33-a60c-fa0c30bbf760" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "x-ms-export-configuration-count": [ - "1" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-correlation-request-id": [ - "043b7a64-b37f-4cd9-bea0-381068bf8bd3" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093647Z:043b7a64-b37f-4cd9-bea0-381068bf8bd3" - ], - "Date": [ - "Sat, 02 May 2020 09:36:46 GMT" - ], - "Content-Length": [ - "909" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"ExportId\": \"HVTIk5pJGzYqAe10rHb2McBj5Q=\",\r\n \"InstrumentationKey\": \"52671e8e-c7d0-45ad-8dac-506faa0ac74e\",\r\n \"RecordTypes\": \"Requests, Event\",\r\n \"ApplicationName\": \"apppstestrg6310\",\r\n \"SubscriptionId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"ResourceGroup\": \"pstestrg6310\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg6310/providers/Microsoft.Storage/storageAccounts/dummysa\",\r\n \"DestinationType\": \"Blob\",\r\n \"IsUserEnabled\": \"True\",\r\n \"LastUserUpdate\": \"2020-05-02T09:36:46.5443765Z\",\r\n \"NotificationQueueEnabled\": \"False\",\r\n \"DestinationKustoCluster\": null,\r\n \"DestinationKustoDatabase\": null,\r\n \"TransformationType\": \"Default\",\r\n \"ExportStatus\": \"Preparing\",\r\n \"LastSuccessTime\": null,\r\n \"LastGapTime\": null,\r\n \"PermanentErrorReason\": \"None\",\r\n \"StorageName\": \"dummysa\",\r\n \"ContainerName\": \"dummycontianer\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg6310/providers/Microsoft.Insights/components/apppstestrg6310/exportconfiguration/HVTIk5pJGzYqAe10rHb2McBj5Q%3D?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjMxMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc2MzEwL2V4cG9ydGNvbmZpZ3VyYXRpb24vSFZUSWs1cEpHellxQWUxMHJIYjJNY0JqNVElM0Q/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"RecordTypes\": \"Requests,Event,Exceptions\",\r\n \"DestinationType\": \"Blob\",\r\n \"DestinationAddress\": \"https://dummysa.blob.core.windows.net/dummycontianer?sv=2015-04-05&sr=c&sig=xxxxxxxxx&sp=w\",\r\n \"IsEnabled\": \"true\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg6310/providers/Microsoft.Storage/storageAccounts/dummysa\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "eea60e76-548e-48fa-8e9d-2db8dcd8f5c7" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "509" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "eea60e76-548e-48fa-8e9d-2db8dcd8f5c7" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-AspNet-Version": [ - "4.0.30319" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "d8778be5-ee9a-4352-9583-a2e3c54a3344" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093647Z:d8778be5-ee9a-4352-9583-a2e3c54a3344" - ], - "Date": [ - "Sat, 02 May 2020 09:36:46 GMT" - ], - "Content-Length": [ - "921" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"ExportId\": \"HVTIk5pJGzYqAe10rHb2McBj5Q=\",\r\n \"InstrumentationKey\": \"52671e8e-c7d0-45ad-8dac-506faa0ac74e\",\r\n \"RecordTypes\": \"Requests, Event, Exceptions\",\r\n \"ApplicationName\": \"apppstestrg6310\",\r\n \"SubscriptionId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"ResourceGroup\": \"pstestrg6310\",\r\n \"DestinationStorageSubscriptionId\": \"50359d91-7b9d-4823-85af-eb298a61ba97\",\r\n \"DestinationStorageLocationId\": \"eastus\",\r\n \"DestinationAccountId\": \"/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba97/resourceGroups/pstestrg6310/providers/Microsoft.Storage/storageAccounts/dummysa\",\r\n \"DestinationType\": \"Blob\",\r\n \"IsUserEnabled\": \"True\",\r\n \"LastUserUpdate\": \"2020-05-02T09:36:47.7323105Z\",\r\n \"NotificationQueueEnabled\": \"False\",\r\n \"DestinationKustoCluster\": null,\r\n \"DestinationKustoDatabase\": null,\r\n \"TransformationType\": \"Default\",\r\n \"ExportStatus\": \"Preparing\",\r\n \"LastSuccessTime\": null,\r\n \"LastGapTime\": null,\r\n \"PermanentErrorReason\": \"None\",\r\n \"StorageName\": \"dummysa\",\r\n \"ContainerName\": \"dummycontianer\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg6310/providers/Microsoft.Insights/components/apppstestrg6310?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnNjMxMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc2MzEwP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "bed8a532-23c0-4f20-a953-1e347ca02341" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "bed8a532-23c0-4f20-a953-1e347ca02341" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-correlation-request-id": [ - "ba210625-3174-4aca-acc4-40f92ab7da33" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093652Z:ba210625-3174-4aca-acc4-40f92ab7da33" - ], - "Date": [ - "Sat, 02 May 2020 09:36:52 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg6310?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnNjMxMD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "fc922e67-4de5-49bf-9e5c-c3961c79c366" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzMTAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-request-id": [ - "0ffc6bd0-1257-4e37-96aa-d2b5fb9ea288" - ], - "x-ms-correlation-request-id": [ - "0ffc6bd0-1257-4e37-96aa-d2b5fb9ea288" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093656Z:0ffc6bd0-1257-4e37-96aa-d2b5fb9ea288" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:36:56 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzMTAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSell6TVRBdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzMTAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" - ], - "x-ms-request-id": [ - "86e42a13-f1e9-4fd2-99f1-ab3973687183" - ], - "x-ms-correlation-request-id": [ - "86e42a13-f1e9-4fd2-99f1-ab3973687183" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093712Z:86e42a13-f1e9-4fd2-99f1-ab3973687183" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:37:11 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzMTAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSell6TVRBdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzMTAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-request-id": [ - "68965b6b-a7f0-44d2-944a-ed98a248a705" - ], - "x-ms-correlation-request-id": [ - "68965b6b-a7f0-44d2-944a-ed98a248a705" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093727Z:68965b6b-a7f0-44d2-944a-ed98a248a705" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:37:26 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzMTAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSell6TVRBdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-request-id": [ - "f804564f-1de6-452d-86e5-2d7d2eb93e3b" - ], - "x-ms-correlation-request-id": [ - "f804564f-1de6-452d-86e5-2d7d2eb93e3b" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093743Z:f804564f-1de6-452d-86e5-2d7d2eb93e3b" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:37:43 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzYzMTAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSell6TVRBdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-request-id": [ - "53923732-42f6-4455-bf8f-3657d8bed5d1" - ], - "x-ms-correlation-request-id": [ - "53923732-42f6-4455-bf8f-3657d8bed5d1" - ], - "x-ms-routing-request-id": [ - "JAPANEAST:20200502T093743Z:53923732-42f6-4455-bf8f-3657d8bed5d1" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Sat, 02 May 2020 09:37:43 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-SetApplicationInsightsContinuousExport": [ - "pstestrg6310" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.LinkedStorageAccountTests/TestLinkedStorageAccountCRUD.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.LinkedStorageAccountTests/TestLinkedStorageAccountCRUD.json deleted file mode 100644 index 49475577ea23..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.LinkedStorageAccountTests/TestLinkedStorageAccountCRUD.json +++ /dev/null @@ -1,2309 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlZ3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "92007858-f9fa-415d-af3f-60b42a53ffa0" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-request-id": [ - "f12294c8-f5af-475c-b258-44ba5d4164ed" - ], - "x-ms-correlation-request-id": [ - "f12294c8-f5af-475c-b258-44ba5d4164ed" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054403Z:f12294c8-f5af-475c-b258-44ba5d4164ed" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:44:02 GMT" - ], - "Content-Length": [ - "193" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock\",\r\n \"name\": \"azps-test-group-mock\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Insights/components/azps-test-ai-mock?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jaz9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "a844b8e8-5a6a-4fd5-bfa1-7f4c2db8a110" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "05cb7993-4d8e-4cc9-a488-8c5e3240e078" - ], - "x-ms-correlation-request-id": [ - "05cb7993-4d8e-4cc9-a488-8c5e3240e078" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054403Z:05cb7993-4d8e-4cc9-a488-8c5e3240e078" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:44:03 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "239" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/azps-test-ai-mock' under resource group 'azps-test-group-mock' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Insights/components/azps-test-ai-mock?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jaz9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "a844b8e8-5a6a-4fd5-bfa1-7f4c2db8a110" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "a844b8e8-5a6a-4fd5-bfa1-7f4c2db8a110" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "c9cde1e0-6009-495a-8ff3-1a7e2129db17" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054416Z:c9cde1e0-6009-495a-8ff3-1a7e2129db17" - ], - "Date": [ - "Tue, 08 Jun 2021 05:44:15 GMT" - ], - "Content-Length": [ - "1034" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock\",\r\n \"name\": \"azps-test-ai-mock\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"d700f443-0000-0100-0000-60bf03ab0000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"azps-test-ai-mock\",\r\n \"AppId\": \"471e224b-0001-49fa-8312-7a2f374c8d9a\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"706be9f2-f8b3-4c9e-8ee7-bccb48e01297\",\r\n \"ConnectionString\": \"InstrumentationKey=706be9f2-f8b3-4c9e-8ee7-bccb48e01297;IngestionEndpoint=https://eastus-3.in.applicationinsights.azure.com/\",\r\n \"Name\": \"azps-test-ai-mock\",\r\n \"CreationDate\": \"2021-06-08T13:44:11.4527027+08:00\",\r\n \"TenantId\": \"9e223dbe-3399-4e19-88eb-0975f02ac87f\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"RetentionInDays\": 90,\r\n \"IngestionMode\": \"ApplicationInsights\",\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/checkNameAvailability?api-version=2021-04-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9jaGVja05hbWVBdmFpbGFiaWxpdHk/YXBpLXZlcnNpb249MjAyMS0wNC0wMQ==", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"name\": \"azpstestaccountamock\",\r\n \"type\": \"Microsoft.Storage/storageAccounts\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "6245670c-47a0-488d-831c-5d6a95898571" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Storage.StorageManagementClient/22.0.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "86" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "cacef005-b0a0-451d-aff3-bacdd8d57151" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-correlation-request-id": [ - "7bed2c9c-8d74-47fc-8f5c-d571d3ee796c" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054417Z:7bed2c9c-8d74-47fc-8f5c-d571d3ee796c" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:44:17 GMT" - ], - "Content-Length": [ - "22" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"nameAvailable\": true\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/checkNameAvailability?api-version=2021-04-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9jaGVja05hbWVBdmFpbGFiaWxpdHk/YXBpLXZlcnNpb249MjAyMS0wNC0wMQ==", - "RequestMethod": "POST", - "RequestBody": "{\r\n \"name\": \"azpstestaccountbmock\",\r\n \"type\": \"Microsoft.Storage/storageAccounts\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "0462578f-c7ca-41df-ac2a-92edaa7b7665" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Storage.StorageManagementClient/22.0.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "86" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "540bcb06-289c-4d0e-976d-f8be6ce64670" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-correlation-request-id": [ - "7b1354a3-5dc2-4a16-a618-008965cc46f3" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054443Z:7b1354a3-5dc2-4a16-a618-008965cc46f3" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:44:43 GMT" - ], - "Content-Length": [ - "22" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"nameAvailable\": true\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock?api-version=2021-04-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9zdG9yYWdlQWNjb3VudHMvYXpwc3Rlc3RhY2NvdW50YW1vY2s/YXBpLXZlcnNpb249MjAyMS0wNC0wMQ==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\"\r\n },\r\n \"kind\": \"StorageV2\",\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "6245670c-47a0-488d-831c-5d6a95898571" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Storage.StorageManagementClient/22.0.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "98" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/589d67a8-9a00-4bf3-8341-8c08ea6f9b42?monitor=true&api-version=2021-04-01" - ], - "Retry-After": [ - "17" - ], - "x-ms-request-id": [ - "589d67a8-9a00-4bf3-8341-8c08ea6f9b42" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "2a3cc8bf-4b8c-4aaa-a3cf-937799622955" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054425Z:2a3cc8bf-4b8c-4aaa-a3cf-937799622955" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:44:25 GMT" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/589d67a8-9a00-4bf3-8341-8c08ea6f9b42?monitor=true&api-version=2021-04-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9sb2NhdGlvbnMvZWFzdHVzL2FzeW5jb3BlcmF0aW9ucy81ODlkNjdhOC05YTAwLTRiZjMtODM0MS04YzA4ZWE2ZjliNDI/bW9uaXRvcj10cnVlJmFwaS12ZXJzaW9uPTIwMjEtMDQtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "6245670c-47a0-488d-831c-5d6a95898571" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Storage.StorageManagementClient/22.0.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "bb6f0147-28d2-4ffb-908c-46909dff14c5" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-correlation-request-id": [ - "243eea87-091e-4433-91f1-38fb628c8875" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054442Z:243eea87-091e-4433-91f1-38fb628c8875" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:44:42 GMT" - ], - "Content-Length": [ - "1400" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"kind\": \"StorageV2\",\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock\",\r\n \"name\": \"azpstestaccountamock\",\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"keyCreationTime\": {\r\n \"key1\": \"2021-06-08T05:44:23.5021773Z\",\r\n \"key2\": \"2021-06-08T05:44:23.5021773Z\"\r\n },\r\n \"privateEndpointConnections\": [],\r\n \"networkAcls\": {\r\n \"bypass\": \"AzureServices\",\r\n \"virtualNetworkRules\": [],\r\n \"ipRules\": [],\r\n \"defaultAction\": \"Allow\"\r\n },\r\n \"supportsHttpsTrafficOnly\": true,\r\n \"encryption\": {\r\n \"services\": {\r\n \"file\": {\r\n \"keyType\": \"Account\",\r\n \"enabled\": true,\r\n \"lastEnabledTime\": \"2021-06-08T05:44:23.5021773Z\"\r\n },\r\n \"blob\": {\r\n \"keyType\": \"Account\",\r\n \"enabled\": true,\r\n \"lastEnabledTime\": \"2021-06-08T05:44:23.5021773Z\"\r\n }\r\n },\r\n \"keySource\": \"Microsoft.Storage\"\r\n },\r\n \"accessTier\": \"Hot\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"creationTime\": \"2021-06-08T05:44:23.3928074Z\",\r\n \"primaryEndpoints\": {\r\n \"dfs\": \"https://azpstestaccountamock.dfs.core.windows.net/\",\r\n \"web\": \"https://azpstestaccountamock.z13.web.core.windows.net/\",\r\n \"blob\": \"https://azpstestaccountamock.blob.core.windows.net/\",\r\n \"queue\": \"https://azpstestaccountamock.queue.core.windows.net/\",\r\n \"table\": \"https://azpstestaccountamock.table.core.windows.net/\",\r\n \"file\": \"https://azpstestaccountamock.file.core.windows.net/\"\r\n },\r\n \"primaryLocation\": \"eastus\",\r\n \"statusOfPrimary\": \"available\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock?api-version=2021-04-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9zdG9yYWdlQWNjb3VudHMvYXpwc3Rlc3RhY2NvdW50YW1vY2s/YXBpLXZlcnNpb249MjAyMS0wNC0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "6245670c-47a0-488d-831c-5d6a95898571" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Storage.StorageManagementClient/22.0.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "9139c30e-d6cf-4d52-823c-19a1345391cc" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11995" - ], - "x-ms-correlation-request-id": [ - "c49d4ff5-4eed-4f34-add9-01507bd120d2" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054442Z:c49d4ff5-4eed-4f34-add9-01507bd120d2" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:44:42 GMT" - ], - "Content-Length": [ - "1400" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"kind\": \"StorageV2\",\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock\",\r\n \"name\": \"azpstestaccountamock\",\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"keyCreationTime\": {\r\n \"key1\": \"2021-06-08T05:44:23.5021773Z\",\r\n \"key2\": \"2021-06-08T05:44:23.5021773Z\"\r\n },\r\n \"privateEndpointConnections\": [],\r\n \"networkAcls\": {\r\n \"bypass\": \"AzureServices\",\r\n \"virtualNetworkRules\": [],\r\n \"ipRules\": [],\r\n \"defaultAction\": \"Allow\"\r\n },\r\n \"supportsHttpsTrafficOnly\": true,\r\n \"encryption\": {\r\n \"services\": {\r\n \"file\": {\r\n \"keyType\": \"Account\",\r\n \"enabled\": true,\r\n \"lastEnabledTime\": \"2021-06-08T05:44:23.5021773Z\"\r\n },\r\n \"blob\": {\r\n \"keyType\": \"Account\",\r\n \"enabled\": true,\r\n \"lastEnabledTime\": \"2021-06-08T05:44:23.5021773Z\"\r\n }\r\n },\r\n \"keySource\": \"Microsoft.Storage\"\r\n },\r\n \"accessTier\": \"Hot\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"creationTime\": \"2021-06-08T05:44:23.3928074Z\",\r\n \"primaryEndpoints\": {\r\n \"dfs\": \"https://azpstestaccountamock.dfs.core.windows.net/\",\r\n \"web\": \"https://azpstestaccountamock.z13.web.core.windows.net/\",\r\n \"blob\": \"https://azpstestaccountamock.blob.core.windows.net/\",\r\n \"queue\": \"https://azpstestaccountamock.queue.core.windows.net/\",\r\n \"table\": \"https://azpstestaccountamock.table.core.windows.net/\",\r\n \"file\": \"https://azpstestaccountamock.file.core.windows.net/\"\r\n },\r\n \"primaryLocation\": \"eastus\",\r\n \"statusOfPrimary\": \"available\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountbmock?api-version=2021-04-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9zdG9yYWdlQWNjb3VudHMvYXpwc3Rlc3RhY2NvdW50Ym1vY2s/YXBpLXZlcnNpb249MjAyMS0wNC0wMQ==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\"\r\n },\r\n \"kind\": \"StorageV2\",\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "0462578f-c7ca-41df-ac2a-92edaa7b7665" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Storage.StorageManagementClient/22.0.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "98" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/8e545f66-e632-4291-9829-a61848d161bf?monitor=true&api-version=2021-04-01" - ], - "Retry-After": [ - "17" - ], - "x-ms-request-id": [ - "8e545f66-e632-4291-9829-a61848d161bf" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "573df561-68b9-4775-9911-1c73acda4ae4" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054447Z:573df561-68b9-4775-9911-1c73acda4ae4" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:44:47 GMT" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/8e545f66-e632-4291-9829-a61848d161bf?monitor=true&api-version=2021-04-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9sb2NhdGlvbnMvZWFzdHVzL2FzeW5jb3BlcmF0aW9ucy84ZTU0NWY2Ni1lNjMyLTQyOTEtOTgyOS1hNjE4NDhkMTYxYmY/bW9uaXRvcj10cnVlJmFwaS12ZXJzaW9uPTIwMjEtMDQtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "0462578f-c7ca-41df-ac2a-92edaa7b7665" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Storage.StorageManagementClient/22.0.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "a4b81183-ed9f-4b0a-9b70-892cdfec091e" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" - ], - "x-ms-correlation-request-id": [ - "407de51c-f83c-408e-b41b-c240ad4865f4" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054504Z:407de51c-f83c-408e-b41b-c240ad4865f4" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:04 GMT" - ], - "Content-Length": [ - "1400" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"kind\": \"StorageV2\",\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountbmock\",\r\n \"name\": \"azpstestaccountbmock\",\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"keyCreationTime\": {\r\n \"key1\": \"2021-06-08T05:44:45.9275641Z\",\r\n \"key2\": \"2021-06-08T05:44:45.9275641Z\"\r\n },\r\n \"privateEndpointConnections\": [],\r\n \"networkAcls\": {\r\n \"bypass\": \"AzureServices\",\r\n \"virtualNetworkRules\": [],\r\n \"ipRules\": [],\r\n \"defaultAction\": \"Allow\"\r\n },\r\n \"supportsHttpsTrafficOnly\": true,\r\n \"encryption\": {\r\n \"services\": {\r\n \"file\": {\r\n \"keyType\": \"Account\",\r\n \"enabled\": true,\r\n \"lastEnabledTime\": \"2021-06-08T05:44:45.9275641Z\"\r\n },\r\n \"blob\": {\r\n \"keyType\": \"Account\",\r\n \"enabled\": true,\r\n \"lastEnabledTime\": \"2021-06-08T05:44:45.9275641Z\"\r\n }\r\n },\r\n \"keySource\": \"Microsoft.Storage\"\r\n },\r\n \"accessTier\": \"Hot\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"creationTime\": \"2021-06-08T05:44:45.8337719Z\",\r\n \"primaryEndpoints\": {\r\n \"dfs\": \"https://azpstestaccountbmock.dfs.core.windows.net/\",\r\n \"web\": \"https://azpstestaccountbmock.z13.web.core.windows.net/\",\r\n \"blob\": \"https://azpstestaccountbmock.blob.core.windows.net/\",\r\n \"queue\": \"https://azpstestaccountbmock.queue.core.windows.net/\",\r\n \"table\": \"https://azpstestaccountbmock.table.core.windows.net/\",\r\n \"file\": \"https://azpstestaccountbmock.file.core.windows.net/\"\r\n },\r\n \"primaryLocation\": \"eastus\",\r\n \"statusOfPrimary\": \"available\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountbmock?api-version=2021-04-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9zdG9yYWdlQWNjb3VudHMvYXpwc3Rlc3RhY2NvdW50Ym1vY2s/YXBpLXZlcnNpb249MjAyMS0wNC0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "0462578f-c7ca-41df-ac2a-92edaa7b7665" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Storage.StorageManagementClient/22.0.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "1016f7fc-d472-4aa8-af23-874cdb5b8bd8" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11992" - ], - "x-ms-correlation-request-id": [ - "92c1a070-581a-42ec-885e-07bde1ab765e" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054505Z:92c1a070-581a-42ec-885e-07bde1ab765e" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:04 GMT" - ], - "Content-Length": [ - "1400" - ], - "Content-Type": [ - "application/json" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"kind\": \"StorageV2\",\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountbmock\",\r\n \"name\": \"azpstestaccountbmock\",\r\n \"type\": \"Microsoft.Storage/storageAccounts\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"keyCreationTime\": {\r\n \"key1\": \"2021-06-08T05:44:45.9275641Z\",\r\n \"key2\": \"2021-06-08T05:44:45.9275641Z\"\r\n },\r\n \"privateEndpointConnections\": [],\r\n \"networkAcls\": {\r\n \"bypass\": \"AzureServices\",\r\n \"virtualNetworkRules\": [],\r\n \"ipRules\": [],\r\n \"defaultAction\": \"Allow\"\r\n },\r\n \"supportsHttpsTrafficOnly\": true,\r\n \"encryption\": {\r\n \"services\": {\r\n \"file\": {\r\n \"keyType\": \"Account\",\r\n \"enabled\": true,\r\n \"lastEnabledTime\": \"2021-06-08T05:44:45.9275641Z\"\r\n },\r\n \"blob\": {\r\n \"keyType\": \"Account\",\r\n \"enabled\": true,\r\n \"lastEnabledTime\": \"2021-06-08T05:44:45.9275641Z\"\r\n }\r\n },\r\n \"keySource\": \"Microsoft.Storage\"\r\n },\r\n \"accessTier\": \"Hot\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"creationTime\": \"2021-06-08T05:44:45.8337719Z\",\r\n \"primaryEndpoints\": {\r\n \"dfs\": \"https://azpstestaccountbmock.dfs.core.windows.net/\",\r\n \"web\": \"https://azpstestaccountbmock.z13.web.core.windows.net/\",\r\n \"blob\": \"https://azpstestaccountbmock.blob.core.windows.net/\",\r\n \"queue\": \"https://azpstestaccountbmock.queue.core.windows.net/\",\r\n \"table\": \"https://azpstestaccountbmock.table.core.windows.net/\",\r\n \"file\": \"https://azpstestaccountbmock.file.core.windows.net/\"\r\n },\r\n \"primaryLocation\": \"eastus\",\r\n \"statusOfPrimary\": \"available\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "bb95f9da-1576-4f0d-bcaa-64553f66ab4a" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-request-id": [ - "e4dd22ab-a930-4a10-aced-fea3908977d0" - ], - "x-ms-correlation-request-id": [ - "e4dd22ab-a930-4a10-aced-fea3908977d0" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054505Z:e4dd22ab-a930-4a10-aced-fea3908977d0" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:04 GMT" - ], - "Content-Length": [ - "4" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "null", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "cbaacc7e-8e4e-4cb8-bff8-10a6c93372f4" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-request-id": [ - "b2286e14-dbb8-4f0d-b817-9a7ca72bf036" - ], - "x-ms-correlation-request-id": [ - "b2286e14-dbb8-4f0d-b817-9a7ca72bf036" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054513Z:b2286e14-dbb8-4f0d-b817-9a7ca72bf036" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:12 GMT" - ], - "Content-Length": [ - "504" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedstorageaccounts/serviceprofiler\",\r\n \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "f9d4cc05-d437-48c3-8b95-098882ca4c09" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-request-id": [ - "9ebbb60c-f7b8-4eb8-ad70-2cb3043b229f" - ], - "x-ms-correlation-request-id": [ - "9ebbb60c-f7b8-4eb8-ad70-2cb3043b229f" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054514Z:9ebbb60c-f7b8-4eb8-ad70-2cb3043b229f" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:13 GMT" - ], - "Content-Length": [ - "504" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedstorageaccounts/serviceprofiler\",\r\n \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "a53540fc-fc1a-4fbb-8a85-b2b7f023610c" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11995" - ], - "x-ms-request-id": [ - "ace7c8a1-d4c8-446a-8739-f63261ff2080" - ], - "x-ms-correlation-request-id": [ - "ace7c8a1-d4c8-446a-8739-f63261ff2080" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054518Z:ace7c8a1-d4c8-446a-8739-f63261ff2080" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:17 GMT" - ], - "Content-Length": [ - "504" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedstorageaccounts/serviceprofiler\",\r\n \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountbmock\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "b733e04f-17dc-4b08-a46c-5422e1f5c44e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-request-id": [ - "e47d44f9-8828-46d2-920a-32c7e9820ed6" - ], - "x-ms-correlation-request-id": [ - "e47d44f9-8828-46d2-920a-32c7e9820ed6" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054521Z:e47d44f9-8828-46d2-920a-32c7e9820ed6" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:21 GMT" - ], - "Content-Length": [ - "4" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "null", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "14f66f0f-2f25-4b4f-b4a7-facf13b4b301" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" - ], - "x-ms-request-id": [ - "ea2d65e9-2d61-4959-bfa8-13651106d95e" - ], - "x-ms-correlation-request-id": [ - "ea2d65e9-2d61-4959-bfa8-13651106d95e" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054526Z:ea2d65e9-2d61-4959-bfa8-13651106d95e" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:26 GMT" - ], - "Content-Length": [ - "504" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedstorageaccounts/serviceprofiler\",\r\n \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "32df6cfb-b061-4a51-af32-be4e15403e74" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11992" - ], - "x-ms-request-id": [ - "81b29013-75b4-412c-8425-ef9f1099b9ab" - ], - "x-ms-correlation-request-id": [ - "81b29013-75b4-412c-8425-ef9f1099b9ab" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054526Z:81b29013-75b4-412c-8425-ef9f1099b9ab" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:26 GMT" - ], - "Content-Length": [ - "504" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedstorageaccounts/serviceprofiler\",\r\n \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "2ef10fb5-c241-48d9-bd6b-14f526c0714e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11991" - ], - "x-ms-request-id": [ - "bef7e70c-caef-4b81-bac3-5150309b262f" - ], - "x-ms-correlation-request-id": [ - "bef7e70c-caef-4b81-bac3-5150309b262f" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054531Z:bef7e70c-caef-4b81-bac3-5150309b262f" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:31 GMT" - ], - "Content-Length": [ - "504" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedstorageaccounts/serviceprofiler\",\r\n \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountbmock\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock\"\r\n }\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "bb95f9da-1576-4f0d-bcaa-64553f66ab4a" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "212" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-request-id": [ - "1eb0ea3e-9e4b-4a4a-851f-0c487ba89916" - ], - "x-ms-correlation-request-id": [ - "1eb0ea3e-9e4b-4a4a-851f-0c487ba89916" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054513Z:1eb0ea3e-9e4b-4a4a-851f-0c487ba89916" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:12 GMT" - ], - "Content-Length": [ - "504" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedstorageaccounts/serviceprofiler\",\r\n \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock\"\r\n }\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "b733e04f-17dc-4b08-a46c-5422e1f5c44e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "212" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1196" - ], - "x-ms-request-id": [ - "a8f2bf83-f18e-473b-af94-2acfb4357b3b" - ], - "x-ms-correlation-request-id": [ - "a8f2bf83-f18e-473b-af94-2acfb4357b3b" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054526Z:a8f2bf83-f18e-473b-af94-2acfb4357b3b" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:26 GMT" - ], - "Content-Length": [ - "504" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedstorageaccounts/serviceprofiler\",\r\n \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "PATCH", - "RequestBody": "{\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountbmock\"\r\n }\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "f9d4cc05-d437-48c3-8b95-098882ca4c09" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "212" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1197" - ], - "x-ms-request-id": [ - "d397bdef-87df-4ab3-ba08-9a5d346c2dc6" - ], - "x-ms-correlation-request-id": [ - "d397bdef-87df-4ab3-ba08-9a5d346c2dc6" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054518Z:d397bdef-87df-4ab3-ba08-9a5d346c2dc6" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:17 GMT" - ], - "Content-Length": [ - "504" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedstorageaccounts/serviceprofiler\",\r\n \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountbmock\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "PATCH", - "RequestBody": "{\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountbmock\"\r\n }\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "32df6cfb-b061-4a51-af32-be4e15403e74" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "212" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1195" - ], - "x-ms-request-id": [ - "0c4d7cdd-f4e2-4a40-9bbe-c223f7672561" - ], - "x-ms-correlation-request-id": [ - "0c4d7cdd-f4e2-4a40-9bbe-c223f7672561" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054531Z:0c4d7cdd-f4e2-4a40-9bbe-c223f7672561" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:31 GMT" - ], - "Content-Length": [ - "504" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedstorageaccounts/serviceprofiler\",\r\n \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountbmock\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "ccd3bf29-5fe2-4382-8b2c-79638fa4f58c" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-request-id": [ - "8f888ad7-df95-4b0d-a10f-52b5e4d7cd20" - ], - "x-ms-correlation-request-id": [ - "8f888ad7-df95-4b0d-a10f-52b5e4d7cd20" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054521Z:8f888ad7-df95-4b0d-a10f-52b5e4d7cd20" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:21 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/microsoft.insights/components/azps-test-ai-mock/linkedStorageAccounts/ServiceProfiler?api-version=2020-03-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9taWNyb3NvZnQuaW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jay9saW5rZWRTdG9yYWdlQWNjb3VudHMvU2VydmljZVByb2ZpbGVyP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDEtcHJldmlldw==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "7e0e3daa-5bce-4cf4-882e-3a3a76fb5c32" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Request-Context": [ - "appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-request-id": [ - "a3943189-bb11-4fc5-ab53-be4cee41bbcb" - ], - "x-ms-correlation-request-id": [ - "a3943189-bb11-4fc5-ab53-be4cee41bbcb" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054533Z:a3943189-bb11-4fc5-ab53-be4cee41bbcb" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:33 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountamock?api-version=2021-04-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9zdG9yYWdlQWNjb3VudHMvYXpwc3Rlc3RhY2NvdW50YW1vY2s/YXBpLXZlcnNpb249MjAyMS0wNC0wMQ==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "1d951354-c6d4-4083-b722-11bf9e72e3f4" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Storage.StorageManagementClient/22.0.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "5a52784d-8b8a-4ae4-9fe9-77a44a87afe7" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-correlation-request-id": [ - "1a48e871-0c44-4201-ab29-b2a7bcaa02e7" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054541Z:1a48e871-0c44-4201-ab29-b2a7bcaa02e7" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:40 GMT" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Storage/storageAccounts/azpstestaccountbmock?api-version=2021-04-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9zdG9yYWdlQWNjb3VudHMvYXpwc3Rlc3RhY2NvdW50Ym1vY2s/YXBpLXZlcnNpb249MjAyMS0wNC0wMQ==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "80f8705e-9491-40fb-bf74-17a0080bf3cf" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Storage.StorageManagementClient/22.0.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "25ea6d2b-0682-47bf-814b-38c564e3e317" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-correlation-request-id": [ - "5c4923cd-9969-46e5-a245-2da78c3e409b" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054545Z:5c4923cd-9969-46e5-a245-2da78c3e409b" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:45 GMT" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-test-group-mock/providers/Microsoft.Insights/components/azps-test-ai-mock?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrL3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9henBzLXRlc3QtYWktbW9jaz9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "e6ee2b01-10da-482c-9a1e-9453df0ee695" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "e6ee2b01-10da-482c-9a1e-9453df0ee695" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14997" - ], - "x-ms-correlation-request-id": [ - "64e67ab9-afac-42f3-88b5-eb470d230d8b" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054557Z:64e67ab9-afac-42f3-88b5-eb470d230d8b" - ], - "Date": [ - "Tue, 08 Jun 2021 05:45:57 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlZ3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "120c369e-3caa-400e-9f2c-69dade84c4cd" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-request-id": [ - "c5b1c949-d4f1-468b-a21d-7dcf8dcf2636" - ], - "x-ms-correlation-request-id": [ - "c5b1c949-d4f1-468b-a21d-7dcf8dcf2636" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054601Z:c5b1c949-d4f1-468b-a21d-7dcf8dcf2636" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:46:01 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/azps-test-group-mock?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlZ3JvdXBzL2F6cHMtdGVzdC1ncm91cC1tb2NrP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "c8f30e6f-732f-4445-babe-ffd936a0af43" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-request-id": [ - "3d2fc8c0-0ebb-49ec-9a37-6f0fff537199" - ], - "x-ms-correlation-request-id": [ - "3d2fc8c0-0ebb-49ec-9a37-6f0fff537199" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054649Z:3d2fc8c0-0ebb-49ec-9a37-6f0fff537199" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:46:48 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "112" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'azps-test-group-mock' could not be found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xCVE9qSkVWRVZUVkRveVJFZFNUMVZRT2pKRVRVOURTeTFGUVZOVVZWTWlMQ0pxYjJKTWIyTmhkR2x2YmlJNkltVmhjM1IxY3lKOT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" - ], - "x-ms-request-id": [ - "40906815-ea86-4371-9091-9efe8cc44346" - ], - "x-ms-correlation-request-id": [ - "40906815-ea86-4371-9091-9efe8cc44346" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054617Z:40906815-ea86-4371-9091-9efe8cc44346" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:46:17 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xCVE9qSkVWRVZUVkRveVJFZFNUMVZRT2pKRVRVOURTeTFGUVZOVVZWTWlMQ0pxYjJKTWIyTmhkR2x2YmlJNkltVmhjM1IxY3lKOT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-request-id": [ - "404e941a-6da3-4aeb-a957-eb24361766e9" - ], - "x-ms-correlation-request-id": [ - "404e941a-6da3-4aeb-a957-eb24361766e9" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054632Z:404e941a-6da3-4aeb-a957-eb24361766e9" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:46:32 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xCVE9qSkVWRVZUVkRveVJFZFNUMVZRT2pKRVRVOURTeTFGUVZOVVZWTWlMQ0pxYjJKTWIyTmhkR2x2YmlJNkltVmhjM1IxY3lKOT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-request-id": [ - "e049d098-6f8b-4f05-a644-d45daad97ba8" - ], - "x-ms-correlation-request-id": [ - "e049d098-6f8b-4f05-a644-d45daad97ba8" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054648Z:e049d098-6f8b-4f05-a644-d45daad97ba8" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:46:48 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlBTOjJEVEVTVDoyREdST1VQOjJETU9DSy1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xCVE9qSkVWRVZUVkRveVJFZFNUMVZRT2pKRVRVOURTeTFGUVZOVVZWTWlMQ0pxYjJKTWIyTmhkR2x2YmlJNkltVmhjM1IxY3lKOT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.30015.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.19043.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-request-id": [ - "fb999f56-fb1e-45ce-9707-690a4cd27aee" - ], - "x-ms-correlation-request-id": [ - "fb999f56-fb1e-45ce-9707-690a4cd27aee" - ], - "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20210608T054648Z:fb999f56-fb1e-45ce-9707-690a4cd27aee" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 08 Jun 2021 05:46:48 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": {}, - "Variables": { - "SubscriptionId": "9e223dbe-3399-4e19-88eb-0975f02ac87f" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestGetAppInsightsDailyCap.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestGetAppInsightsDailyCap.json deleted file mode 100644 index f65a97b3ecc6..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestGetAppInsightsDailyCap.json +++ /dev/null @@ -1,780 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg8019?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnODAxOT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "7ca7499d-40ea-49cb-b7ad-eebc1dc0d119" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1197" - ], - "x-ms-request-id": [ - "11407680-4b4e-4bea-b4fc-f3d4a1c39d5b" - ], - "x-ms-correlation-request-id": [ - "11407680-4b4e-4bea-b4fc-f3d4a1c39d5b" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165857Z:11407680-4b4e-4bea-b4fc-f3d4a1c39d5b" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:58:57 GMT" - ], - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg8019\",\r\n \"name\": \"pstestrg8019\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg8019/providers/Microsoft.Insights/components/apppstestrg8019?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnODAxOS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc4MDE5P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "4473f4fe-c787-42d1-a114-f33231681c0d" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "add5a3be-250b-4fa9-97a1-37846aeed086" - ], - "x-ms-correlation-request-id": [ - "add5a3be-250b-4fa9-97a1-37846aeed086" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165858Z:add5a3be-250b-4fa9-97a1-37846aeed086" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:58:58 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "161" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg8019' under resource group 'pstestrg8019' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg8019/providers/Microsoft.Insights/components/apppstestrg8019?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnODAxOS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc4MDE5P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "fb7eedbe-4246-47df-8254-82f4c490fcc3" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "fb7eedbe-4246-47df-8254-82f4c490fcc3" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-correlation-request-id": [ - "6814db98-afb5-4781-90b0-37ff9d6e5c8d" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165910Z:6814db98-afb5-4781-90b0-37ff9d6e5c8d" - ], - "Date": [ - "Tue, 05 May 2020 16:59:10 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg8019/providers/microsoft.insights/components/apppstestrg8019\",\r\n \"name\": \"apppstestrg8019\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"11008000-0000-0100-0000-5eb19b5c0000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg8019\",\r\n \"AppId\": \"efee6265-97b9-4688-93ab-2116d5ecb0cf\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"363c9ffc-195d-4ae5-8322-921b594b3dfe\",\r\n \"ConnectionString\": \"InstrumentationKey=363c9ffc-195d-4ae5-8322-921b594b3dfe\",\r\n \"Name\": \"apppstestrg8019\",\r\n \"CreationDate\": \"2020-05-06T00:59:07.9084053+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg8019/providers/Microsoft.Insights/components/apppstestrg8019?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnODAxOS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc4MDE5P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "e7e8688b-08c9-472c-9ce3-af14f14d10b5" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "e7e8688b-08c9-472c-9ce3-af14f14d10b5" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "fadd0fe0-7171-4f89-a733-53bb249a84d3" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165910Z:fadd0fe0-7171-4f89-a733-53bb249a84d3" - ], - "Date": [ - "Tue, 05 May 2020 16:59:10 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg8019/providers/microsoft.insights/components/apppstestrg8019\",\r\n \"name\": \"apppstestrg8019\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"11008000-0000-0100-0000-5eb19b5c0000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg8019\",\r\n \"AppId\": \"efee6265-97b9-4688-93ab-2116d5ecb0cf\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"363c9ffc-195d-4ae5-8322-921b594b3dfe\",\r\n \"ConnectionString\": \"InstrumentationKey=363c9ffc-195d-4ae5-8322-921b594b3dfe\",\r\n \"Name\": \"apppstestrg8019\",\r\n \"CreationDate\": \"2020-05-06T00:59:07.9084053+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg8019/providers/Microsoft.Insights/components/apppstestrg8019/currentbillingfeatures?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnODAxOS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc4MDE5L2N1cnJlbnRiaWxsaW5nZmVhdHVyZXM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "0cc44143-062c-41e7-99ad-dab15eb3c868" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "0cc44143-062c-41e7-99ad-dab15eb3c868" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-correlation-request-id": [ - "41f46848-1f35-4f5e-a022-539adc8a4c94" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165914Z:41f46848-1f35-4f5e-a022-539adc8a4c94" - ], - "Date": [ - "Tue, 05 May 2020 16:59:14 GMT" - ], - "Content-Length": [ - "248" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"CurrentBillingFeatures\": [\r\n \"Basic\"\r\n ],\r\n \"DataVolumeCap\": {\r\n \"Cap\": 100.0,\r\n \"MaxHistoryCap\": 1000.0,\r\n \"ResetTime\": 12,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": false\r\n },\r\n \"EndTime\": \"2018-04-02T21:00:00+08:00\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg8019/providers/Microsoft.Insights/components/apppstestrg8019/quotastatus?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnODAxOS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc4MDE5L3F1b3Rhc3RhdHVzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "bb403014-3e40-4886-a25d-d61a1de85c74" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "bb403014-3e40-4886-a25d-d61a1de85c74" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-correlation-request-id": [ - "26f819e0-b617-4f7e-a011-8232abd3ed4d" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165915Z:26f819e0-b617-4f7e-a011-8232abd3ed4d" - ], - "Date": [ - "Tue, 05 May 2020 16:59:14 GMT" - ], - "Content-Length": [ - "122" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"InstrumentationKey\": null,\r\n \"AppId\": \"efee6265-97b9-4688-93ab-2116d5ecb0cf\",\r\n \"ShouldBeThrottled\": false,\r\n \"ExpirationTime\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg8019/providers/Microsoft.Insights/components/apppstestrg8019?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnODAxOS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmc4MDE5P2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "bfeafd37-ab87-4f41-a7d1-9846acb93f18" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "bfeafd37-ab87-4f41-a7d1-9846acb93f18" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-correlation-request-id": [ - "4433329b-02d4-4d46-8d8a-08b51c72e1e1" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165919Z:4433329b-02d4-4d46-8d8a-08b51c72e1e1" - ], - "Date": [ - "Tue, 05 May 2020 16:59:18 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg8019?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnODAxOT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "89505914-8c58-4453-a04c-2e5d7b55cda5" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzgwMTktRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-request-id": [ - "f6e542e1-b551-45a8-9278-b8ebeac18bcc" - ], - "x-ms-correlation-request-id": [ - "f6e542e1-b551-45a8-9278-b8ebeac18bcc" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165923Z:f6e542e1-b551-45a8-9278-b8ebeac18bcc" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:59:23 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzgwMTktRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSemd3TVRrdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzgwMTktRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-request-id": [ - "571466ad-7560-4e4b-b258-d4ca87b5471d" - ], - "x-ms-correlation-request-id": [ - "571466ad-7560-4e4b-b258-d4ca87b5471d" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165939Z:571466ad-7560-4e4b-b258-d4ca87b5471d" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:59:39 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzgwMTktRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSemd3TVRrdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzgwMTktRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" - ], - "x-ms-request-id": [ - "a16f33b0-364e-4ac2-8303-05a393effec3" - ], - "x-ms-correlation-request-id": [ - "a16f33b0-364e-4ac2-8303-05a393effec3" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165955Z:a16f33b0-364e-4ac2-8303-05a393effec3" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:59:54 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzgwMTktRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSemd3TVRrdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11992" - ], - "x-ms-request-id": [ - "f1017899-da9c-4856-8b62-7e1734747ad7" - ], - "x-ms-correlation-request-id": [ - "f1017899-da9c-4856-8b62-7e1734747ad7" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T170010Z:f1017899-da9c-4856-8b62-7e1734747ad7" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 17:00:10 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzgwMTktRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSemd3TVRrdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11991" - ], - "x-ms-request-id": [ - "a05d0c7b-bc70-4c51-b938-1d5a08b0c269" - ], - "x-ms-correlation-request-id": [ - "a05d0c7b-bc70-4c51-b938-1d5a08b0c269" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T170011Z:a05d0c7b-bc70-4c51-b938-1d5a08b0c269" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 17:00:11 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-GetApplicationInsightsDailyCap": [ - "pstestrg8019" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestGetDailyCapStatus.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestGetDailyCapStatus.json deleted file mode 100644 index 3c5400b73838..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestGetDailyCapStatus.json +++ /dev/null @@ -1,780 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg3981?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMzk4MT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "2c2849c4-4f5f-401c-8738-dfffc50172b3" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-request-id": [ - "d83e589a-185c-4be3-b37c-607ecd4e781b" - ], - "x-ms-correlation-request-id": [ - "d83e589a-185c-4be3-b37c-607ecd4e781b" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165436Z:d83e589a-185c-4be3-b37c-607ecd4e781b" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:54:36 GMT" - ], - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3981\",\r\n \"name\": \"pstestrg3981\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3981/providers/Microsoft.Insights/components/apppstestrg3981?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzk4MS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczOTgxP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "df4d65f8-d080-4060-94be-bab4bedaa69a" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "eb6611fb-26e6-41be-8f10-ab26922520ff" - ], - "x-ms-correlation-request-id": [ - "eb6611fb-26e6-41be-8f10-ab26922520ff" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165437Z:eb6611fb-26e6-41be-8f10-ab26922520ff" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:54:36 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "161" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg3981' under resource group 'pstestrg3981' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3981/providers/Microsoft.Insights/components/apppstestrg3981?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzk4MS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczOTgxP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "bdf65417-0414-4f59-b255-569352db5de3" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "bdf65417-0414-4f59-b255-569352db5de3" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-correlation-request-id": [ - "2c3b8520-f63b-4fe6-b80a-40b6de01f3e6" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165448Z:2c3b8520-f63b-4fe6-b80a-40b6de01f3e6" - ], - "Date": [ - "Tue, 05 May 2020 16:54:47 GMT" - ], - "Content-Length": [ - "889" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3981/providers/microsoft.insights/components/apppstestrg3981\",\r\n \"name\": \"apppstestrg3981\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"10002dfb-0000-0100-0000-5eb19a540000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg3981\",\r\n \"AppId\": \"d4a9c6b7-d208-42af-9930-e6000872f64a\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"d246f328-ff9e-48f2-8532-dd59f727f3ab\",\r\n \"ConnectionString\": \"InstrumentationKey=d246f328-ff9e-48f2-8532-dd59f727f3ab\",\r\n \"Name\": \"apppstestrg3981\",\r\n \"CreationDate\": \"2020-05-06T00:54:44.335413+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3981/providers/Microsoft.Insights/components/apppstestrg3981?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzk4MS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczOTgxP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "b2b9360b-3234-4bb1-97a9-a5c7c50dd637" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "b2b9360b-3234-4bb1-97a9-a5c7c50dd637" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "57923a4a-1553-4c5c-b290-09fb7889388b" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165447Z:57923a4a-1553-4c5c-b290-09fb7889388b" - ], - "Date": [ - "Tue, 05 May 2020 16:54:47 GMT" - ], - "Content-Length": [ - "889" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3981/providers/microsoft.insights/components/apppstestrg3981\",\r\n \"name\": \"apppstestrg3981\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"10002dfb-0000-0100-0000-5eb19a540000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg3981\",\r\n \"AppId\": \"d4a9c6b7-d208-42af-9930-e6000872f64a\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"d246f328-ff9e-48f2-8532-dd59f727f3ab\",\r\n \"ConnectionString\": \"InstrumentationKey=d246f328-ff9e-48f2-8532-dd59f727f3ab\",\r\n \"Name\": \"apppstestrg3981\",\r\n \"CreationDate\": \"2020-05-06T00:54:44.335413+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3981/providers/Microsoft.Insights/components/apppstestrg3981/currentbillingfeatures?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzk4MS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczOTgxL2N1cnJlbnRiaWxsaW5nZmVhdHVyZXM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "8ef0c330-690d-4c9c-92b3-fbdb641e2f2c" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "8ef0c330-690d-4c9c-92b3-fbdb641e2f2c" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" - ], - "x-ms-correlation-request-id": [ - "077f3bcb-17d0-4e5d-aae6-3918fab0c24c" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165450Z:077f3bcb-17d0-4e5d-aae6-3918fab0c24c" - ], - "Date": [ - "Tue, 05 May 2020 16:54:49 GMT" - ], - "Content-Length": [ - "247" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"CurrentBillingFeatures\": [\r\n \"Basic\"\r\n ],\r\n \"DataVolumeCap\": {\r\n \"Cap\": 100.0,\r\n \"MaxHistoryCap\": 1000.0,\r\n \"ResetTime\": 1,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": false\r\n },\r\n \"EndTime\": \"2018-04-02T21:00:00+08:00\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3981/providers/Microsoft.Insights/components/apppstestrg3981/quotastatus?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzk4MS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczOTgxL3F1b3Rhc3RhdHVzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "0356b862-f3f5-45c2-a63a-9b589ec27ed3" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "0356b862-f3f5-45c2-a63a-9b589ec27ed3" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11992" - ], - "x-ms-correlation-request-id": [ - "36fe0857-ff5e-4e1a-9fe4-7ac3586d263c" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165450Z:36fe0857-ff5e-4e1a-9fe4-7ac3586d263c" - ], - "Date": [ - "Tue, 05 May 2020 16:54:50 GMT" - ], - "Content-Length": [ - "122" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"InstrumentationKey\": null,\r\n \"AppId\": \"d4a9c6b7-d208-42af-9930-e6000872f64a\",\r\n \"ShouldBeThrottled\": false,\r\n \"ExpirationTime\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg3981/providers/Microsoft.Insights/components/apppstestrg3981?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMzk4MS9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmczOTgxP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "8e4ba5fb-53c2-415e-8aa0-4d79dce9118f" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "8e4ba5fb-53c2-415e-8aa0-4d79dce9118f" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14997" - ], - "x-ms-correlation-request-id": [ - "66fa5c86-ffe7-45e7-bc6a-cc704cb6ff49" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165454Z:66fa5c86-ffe7-45e7-bc6a-cc704cb6ff49" - ], - "Date": [ - "Tue, 05 May 2020 16:54:53 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg3981?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMzk4MT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "5c55b35c-c3f4-4a0e-a944-84d0d78ef204" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzM5ODEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-request-id": [ - "2e124bdf-5c8d-4af9-a165-c01faae5410e" - ], - "x-ms-correlation-request-id": [ - "2e124bdf-5c8d-4af9-a165-c01faae5410e" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165458Z:2e124bdf-5c8d-4af9-a165-c01faae5410e" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:54:57 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzM5ODEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek01T0RFdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzM5ODEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" - ], - "x-ms-request-id": [ - "559127e3-7f4b-4d71-ae1a-2d83cae67d28" - ], - "x-ms-correlation-request-id": [ - "559127e3-7f4b-4d71-ae1a-2d83cae67d28" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165514Z:559127e3-7f4b-4d71-ae1a-2d83cae67d28" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:55:14 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzM5ODEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek01T0RFdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzM5ODEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-request-id": [ - "78e15cc7-8044-48a1-91e6-69e715f2215e" - ], - "x-ms-correlation-request-id": [ - "78e15cc7-8044-48a1-91e6-69e715f2215e" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165529Z:78e15cc7-8044-48a1-91e6-69e715f2215e" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:55:29 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzM5ODEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek01T0RFdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-request-id": [ - "04cc74d5-eccf-4ca1-b8d2-eb5e9b26acfe" - ], - "x-ms-correlation-request-id": [ - "04cc74d5-eccf-4ca1-b8d2-eb5e9b26acfe" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165545Z:04cc74d5-eccf-4ca1-b8d2-eb5e9b26acfe" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:55:44 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzM5ODEtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSek01T0RFdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-request-id": [ - "b4e10beb-5ca5-47ee-9700-5246b51e20c9" - ], - "x-ms-correlation-request-id": [ - "b4e10beb-5ca5-47ee-9700-5246b51e20c9" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165545Z:b4e10beb-5ca5-47ee-9700-5246b51e20c9" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:55:45 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-GetApplicationInsightsDailyCapStatus": [ - "pstestrg3981" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestGetPricingPlan.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestGetPricingPlan.json deleted file mode 100644 index 37b43152dc80..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestGetPricingPlan.json +++ /dev/null @@ -1,780 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg259?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjU5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "ab17bf3a-0ea4-4a1c-a3f9-c4b8e049d1e4" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-request-id": [ - "d3cd3ed8-feb0-433e-a779-df4f089db983" - ], - "x-ms-correlation-request-id": [ - "d3cd3ed8-feb0-433e-a779-df4f089db983" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165558Z:d3cd3ed8-feb0-433e-a779-df4f089db983" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:55:58 GMT" - ], - "Content-Length": [ - "175" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg259\",\r\n \"name\": \"pstestrg259\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg259/providers/Microsoft.Insights/components/apppstestrg259?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU5L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzI1OT9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "80e4a513-80c5-4ae7-a0ff-f1d8311106da" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "1f397728-72ea-459f-9ce4-0cdb2f86f72b" - ], - "x-ms-correlation-request-id": [ - "1f397728-72ea-459f-9ce4-0cdb2f86f72b" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165559Z:1f397728-72ea-459f-9ce4-0cdb2f86f72b" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:55:58 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "159" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg259' under resource group 'pstestrg259' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg259/providers/Microsoft.Insights/components/apppstestrg259?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU5L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzI1OT9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "3ab66202-ea03-491e-aab8-1373f1ff27cb" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "3ab66202-ea03-491e-aab8-1373f1ff27cb" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-correlation-request-id": [ - "31586eac-5658-4771-aac8-e118d41b8d71" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165610Z:31586eac-5658-4771-aac8-e118d41b8d71" - ], - "Date": [ - "Tue, 05 May 2020 16:56:10 GMT" - ], - "Content-Length": [ - "885" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg259/providers/microsoft.insights/components/apppstestrg259\",\r\n \"name\": \"apppstestrg259\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"1000fafc-0000-0100-0000-5eb19aa70000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg259\",\r\n \"AppId\": \"c44ef8b8-812a-4ff7-b88e-50c36792b4f6\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"a64a0dd8-8245-4bcc-81bc-5ad651938df2\",\r\n \"ConnectionString\": \"InstrumentationKey=a64a0dd8-8245-4bcc-81bc-5ad651938df2\",\r\n \"Name\": \"apppstestrg259\",\r\n \"CreationDate\": \"2020-05-06T00:56:06.8857429+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg259/providers/Microsoft.Insights/components/apppstestrg259?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU5L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzI1OT9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "e0412bd3-6dd8-487d-9049-ce5f38d34dfb" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "e0412bd3-6dd8-487d-9049-ce5f38d34dfb" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "2f0a658f-b0fe-4a5d-9093-1e3b9e898e08" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165610Z:2f0a658f-b0fe-4a5d-9093-1e3b9e898e08" - ], - "Date": [ - "Tue, 05 May 2020 16:56:09 GMT" - ], - "Content-Length": [ - "885" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg259/providers/microsoft.insights/components/apppstestrg259\",\r\n \"name\": \"apppstestrg259\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"1000fafc-0000-0100-0000-5eb19aa70000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg259\",\r\n \"AppId\": \"c44ef8b8-812a-4ff7-b88e-50c36792b4f6\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"a64a0dd8-8245-4bcc-81bc-5ad651938df2\",\r\n \"ConnectionString\": \"InstrumentationKey=a64a0dd8-8245-4bcc-81bc-5ad651938df2\",\r\n \"Name\": \"apppstestrg259\",\r\n \"CreationDate\": \"2020-05-06T00:56:06.8857429+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg259/providers/Microsoft.Insights/components/apppstestrg259/currentbillingfeatures?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU5L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzI1OS9jdXJyZW50YmlsbGluZ2ZlYXR1cmVzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "2b382e9e-b949-4e76-bd72-96cc3b8d05c9" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "2b382e9e-b949-4e76-bd72-96cc3b8d05c9" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-correlation-request-id": [ - "7018901c-5709-4370-be6d-55ba66f74a82" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165612Z:7018901c-5709-4370-be6d-55ba66f74a82" - ], - "Date": [ - "Tue, 05 May 2020 16:56:11 GMT" - ], - "Content-Length": [ - "248" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"CurrentBillingFeatures\": [\r\n \"Basic\"\r\n ],\r\n \"DataVolumeCap\": {\r\n \"Cap\": 100.0,\r\n \"MaxHistoryCap\": 1000.0,\r\n \"ResetTime\": 15,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": false\r\n },\r\n \"EndTime\": \"2018-04-02T21:00:00+08:00\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg259/providers/Microsoft.Insights/components/apppstestrg259/quotastatus?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU5L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzI1OS9xdW90YXN0YXR1cz9hcGktdmVyc2lvbj0yMDE1LTA1LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "fd8362b1-a3da-45bd-9764-1f7b0683a778" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "fd8362b1-a3da-45bd-9764-1f7b0683a778" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-correlation-request-id": [ - "1d8120c3-1ed3-4698-9c8d-61b26034bd6b" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165613Z:1d8120c3-1ed3-4698-9c8d-61b26034bd6b" - ], - "Date": [ - "Tue, 05 May 2020 16:56:12 GMT" - ], - "Content-Length": [ - "122" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"InstrumentationKey\": null,\r\n \"AppId\": \"c44ef8b8-812a-4ff7-b88e-50c36792b4f6\",\r\n \"ShouldBeThrottled\": false,\r\n \"ExpirationTime\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg259/providers/Microsoft.Insights/components/apppstestrg259?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU5L3Byb3ZpZGVycy9NaWNyb3NvZnQuSW5zaWdodHMvY29tcG9uZW50cy9hcHBwc3Rlc3RyZzI1OT9hcGktdmVyc2lvbj0yMDE4LTA1LTAxLXByZXZpZXc=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "c8407567-be36-4414-9a12-5dcfa8b38fa4" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "c8407567-be36-4414-9a12-5dcfa8b38fa4" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-correlation-request-id": [ - "92981e69-76b9-49c3-8ad6-a6cd863d6f66" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165616Z:92981e69-76b9-49c3-8ad6-a6cd863d6f66" - ], - "Date": [ - "Tue, 05 May 2020 16:56:15 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg259?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjU5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "1f728ea5-3caf-4a64-9a22-800864f8a924" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1OS1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14998" - ], - "x-ms-request-id": [ - "ebfd7cb5-1fc0-4c4e-b1dd-8d46fac7f2f1" - ], - "x-ms-correlation-request-id": [ - "ebfd7cb5-1fc0-4c4e-b1dd-8d46fac7f2f1" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165620Z:ebfd7cb5-1fc0-4c4e-b1dd-8d46fac7f2f1" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:56:20 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1OS1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkxT1MxRlFWTlVWVk1pTENKcWIySk1iMk5oZEdsdmJpSTZJbVZoYzNSMWN5Sjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1OS1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11995" - ], - "x-ms-request-id": [ - "4f656030-2128-4c70-accf-75779be44952" - ], - "x-ms-correlation-request-id": [ - "4f656030-2128-4c70-accf-75779be44952" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165636Z:4f656030-2128-4c70-accf-75779be44952" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:56:35 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1OS1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkxT1MxRlFWTlVWVk1pTENKcWIySk1iMk5oZEdsdmJpSTZJbVZoYzNSMWN5Sjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1OS1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-request-id": [ - "554c0ac5-92b9-4037-a166-dd2f8ef63eb2" - ], - "x-ms-correlation-request-id": [ - "554c0ac5-92b9-4037-a166-dd2f8ef63eb2" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165651Z:554c0ac5-92b9-4037-a166-dd2f8ef63eb2" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:56:51 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1OS1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkxT1MxRlFWTlVWVk1pTENKcWIySk1iMk5oZEdsdmJpSTZJbVZoYzNSMWN5Sjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" - ], - "x-ms-request-id": [ - "e590a0d8-1f22-4720-a524-79ff2ae009aa" - ], - "x-ms-correlation-request-id": [ - "e590a0d8-1f22-4720-a524-79ff2ae009aa" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165707Z:e590a0d8-1f22-4720-a524-79ff2ae009aa" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:57:07 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1OS1FQVNUVVMiLCJqb2JMb2NhdGlvbiI6ImVhc3R1cyJ9?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkxT1MxRlFWTlVWVk1pTENKcWIySk1iMk5oZEdsdmJpSTZJbVZoYzNSMWN5Sjk/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11992" - ], - "x-ms-request-id": [ - "f64b09f2-1dab-46c2-aa34-75f32e7d85ff" - ], - "x-ms-correlation-request-id": [ - "f64b09f2-1dab-46c2-aa34-75f32e7d85ff" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165707Z:f64b09f2-1dab-46c2-aa34-75f32e7d85ff" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:57:07 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-GetApplicationInsightsPricingPlan": [ - "pstestrg259" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestSetAppInsightsDailyCap.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestSetAppInsightsDailyCap.json deleted file mode 100644 index 6783c61bccdd..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestSetAppInsightsDailyCap.json +++ /dev/null @@ -1,930 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg2572?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjU3Mj9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "b51b1f99-b4fd-4a35-8e3a-8295cece8739" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-request-id": [ - "77cd7d87-fa20-4096-8fc5-a9d3f9adefef" - ], - "x-ms-correlation-request-id": [ - "77cd7d87-fa20-4096-8fc5-a9d3f9adefef" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161623Z:77cd7d87-fa20-4096-8fc5-a9d3f9adefef" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:16:23 GMT" - ], - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2572\",\r\n \"name\": \"pstestrg2572\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2572/providers/Microsoft.Insights/components/apppstestrg2572?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU3Mi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNTcyP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "f523e5a8-6778-443d-8bf9-e9647aa07bd5" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "604b6756-7649-4255-9470-92375ebc4c4c" - ], - "x-ms-correlation-request-id": [ - "604b6756-7649-4255-9470-92375ebc4c4c" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161624Z:604b6756-7649-4255-9470-92375ebc4c4c" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:16:24 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "161" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg2572' under resource group 'pstestrg2572' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2572/providers/Microsoft.Insights/components/apppstestrg2572?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU3Mi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNTcyP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "6d8a3016-aeb7-4e01-95d1-0bc2f6624b9c" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "6d8a3016-aeb7-4e01-95d1-0bc2f6624b9c" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-correlation-request-id": [ - "61fcb95c-3f59-4fb9-b153-08788934a665" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161644Z:61fcb95c-3f59-4fb9-b153-08788934a665" - ], - "Date": [ - "Tue, 05 May 2020 16:16:43 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2572/providers/microsoft.insights/components/apppstestrg2572\",\r\n \"name\": \"apppstestrg2572\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"1000f4d2-0000-0100-0000-5eb191600000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg2572\",\r\n \"AppId\": \"66819122-b0f1-4961-8f6f-330602dfd6c1\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"15eeaa20-2b7b-4afa-ab39-53e6547a0be9\",\r\n \"ConnectionString\": \"InstrumentationKey=15eeaa20-2b7b-4afa-ab39-53e6547a0be9\",\r\n \"Name\": \"apppstestrg2572\",\r\n \"CreationDate\": \"2020-05-06T00:16:32.8206753+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2572/providers/Microsoft.Insights/components/apppstestrg2572?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU3Mi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNTcyP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "16da8312-2a6d-43b7-a776-97c578935d4e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "16da8312-2a6d-43b7-a776-97c578935d4e" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" - ], - "x-ms-correlation-request-id": [ - "6b214ba4-869c-4321-9413-afe2d91f2a7e" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161637Z:6b214ba4-869c-4321-9413-afe2d91f2a7e" - ], - "Date": [ - "Tue, 05 May 2020 16:16:36 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2572/providers/microsoft.insights/components/apppstestrg2572\",\r\n \"name\": \"apppstestrg2572\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"1000f4d2-0000-0100-0000-5eb191600000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg2572\",\r\n \"AppId\": \"66819122-b0f1-4961-8f6f-330602dfd6c1\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"15eeaa20-2b7b-4afa-ab39-53e6547a0be9\",\r\n \"ConnectionString\": \"InstrumentationKey=15eeaa20-2b7b-4afa-ab39-53e6547a0be9\",\r\n \"Name\": \"apppstestrg2572\",\r\n \"CreationDate\": \"2020-05-06T00:16:32.8206753+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2572/providers/Microsoft.Insights/components/apppstestrg2572/currentbillingfeatures?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU3Mi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNTcyL2N1cnJlbnRiaWxsaW5nZmVhdHVyZXM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "b6872070-09c0-44cb-8ccd-8e0ecf66ddf0" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "b6872070-09c0-44cb-8ccd-8e0ecf66ddf0" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-correlation-request-id": [ - "f8fad2db-7011-4a87-b53d-df58a9e4202c" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161640Z:f8fad2db-7011-4a87-b53d-df58a9e4202c" - ], - "Date": [ - "Tue, 05 May 2020 16:16:39 GMT" - ], - "Content-Length": [ - "248" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"CurrentBillingFeatures\": [\r\n \"Basic\"\r\n ],\r\n \"DataVolumeCap\": {\r\n \"Cap\": 100.0,\r\n \"MaxHistoryCap\": 1000.0,\r\n \"ResetTime\": 19,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": false\r\n },\r\n \"EndTime\": \"2018-04-02T21:00:00+08:00\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2572/providers/Microsoft.Insights/components/apppstestrg2572/currentbillingfeatures?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU3Mi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNTcyL2N1cnJlbnRiaWxsaW5nZmVhdHVyZXM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "472e67e2-0d2a-4adc-b8c9-01c461a8ef9e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "472e67e2-0d2a-4adc-b8c9-01c461a8ef9e" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-correlation-request-id": [ - "090a3840-e0d0-46c2-abb3-ea8467372dbe" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161645Z:090a3840-e0d0-46c2-abb3-ea8467372dbe" - ], - "Date": [ - "Tue, 05 May 2020 16:16:45 GMT" - ], - "Content-Length": [ - "246" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"CurrentBillingFeatures\": [\r\n \"Basic\"\r\n ],\r\n \"DataVolumeCap\": {\r\n \"Cap\": 300.0,\r\n \"MaxHistoryCap\": 1000.0,\r\n \"ResetTime\": 0,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": true\r\n },\r\n \"EndTime\": \"2018-04-02T21:00:00+08:00\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2572/providers/Microsoft.Insights/components/apppstestrg2572/currentbillingfeatures?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU3Mi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNTcyL2N1cnJlbnRiaWxsaW5nZmVhdHVyZXM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"DataVolumeCap\": {\r\n \"Cap\": 300.0,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": true\r\n },\r\n \"CurrentBillingFeatures\": [\r\n \"Basic\"\r\n ]\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "58e1a8d8-c587-4659-a2fd-f01823f5a873" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "225" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "58e1a8d8-c587-4659-a2fd-f01823f5a873" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-correlation-request-id": [ - "c46b985c-a74f-4898-9365-05674f0c33d0" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161643Z:c46b985c-a74f-4898-9365-05674f0c33d0" - ], - "Date": [ - "Tue, 05 May 2020 16:16:43 GMT" - ], - "Content-Length": [ - "208" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"CurrentBillingFeatures\": [\r\n \"Basic\"\r\n ],\r\n \"DataVolumeCap\": {\r\n \"Cap\": 300.0,\r\n \"MaxHistoryCap\": 1000.0,\r\n \"ResetTime\": 0,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": true\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2572/providers/Microsoft.Insights/components/apppstestrg2572/quotastatus?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU3Mi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNTcyL3F1b3Rhc3RhdHVzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "4c511cec-6b46-4fec-84c6-57df6abc8214" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "4c511cec-6b46-4fec-84c6-57df6abc8214" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11995" - ], - "x-ms-correlation-request-id": [ - "727ce961-8d26-4a8b-828d-4448c3d45891" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161646Z:727ce961-8d26-4a8b-828d-4448c3d45891" - ], - "Date": [ - "Tue, 05 May 2020 16:16:45 GMT" - ], - "Content-Length": [ - "122" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"InstrumentationKey\": null,\r\n \"AppId\": \"66819122-b0f1-4961-8f6f-330602dfd6c1\",\r\n \"ShouldBeThrottled\": false,\r\n \"ExpirationTime\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg2572/providers/Microsoft.Insights/components/apppstestrg2572?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMjU3Mi9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcyNTcyP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "3490e91f-34c7-498f-9838-300086e6870e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "3490e91f-34c7-498f-9838-300086e6870e" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-correlation-request-id": [ - "51bc0a89-1c3e-40b8-b4a6-cc533cfa6060" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161651Z:51bc0a89-1c3e-40b8-b4a6-cc533cfa6060" - ], - "Date": [ - "Tue, 05 May 2020 16:16:50 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg2572?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMjU3Mj9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "906ae352-0be2-487c-b51a-06011a09e43a" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1NzItRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14999" - ], - "x-ms-request-id": [ - "42ef319b-03a9-4c96-a4c4-0458bf7b6a2d" - ], - "x-ms-correlation-request-id": [ - "42ef319b-03a9-4c96-a4c4-0458bf7b6a2d" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161656Z:42ef319b-03a9-4c96-a4c4-0458bf7b6a2d" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:16:55 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1NzItRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkxTnpJdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1NzItRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" - ], - "x-ms-request-id": [ - "106aa904-5068-472f-81f8-9ce5f9672764" - ], - "x-ms-correlation-request-id": [ - "106aa904-5068-472f-81f8-9ce5f9672764" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161712Z:106aa904-5068-472f-81f8-9ce5f9672764" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:17:11 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1NzItRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkxTnpJdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1NzItRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" - ], - "x-ms-request-id": [ - "87899f9b-0343-49a0-953c-54d707c7aa30" - ], - "x-ms-correlation-request-id": [ - "87899f9b-0343-49a0-953c-54d707c7aa30" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161727Z:87899f9b-0343-49a0-953c-54d707c7aa30" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:17:27 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1NzItRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkxTnpJdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" - ], - "x-ms-request-id": [ - "b3398e58-e29e-4241-bcd5-fb0554f71470" - ], - "x-ms-correlation-request-id": [ - "b3398e58-e29e-4241-bcd5-fb0554f71470" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161743Z:b3398e58-e29e-4241-bcd5-fb0554f71470" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:17:42 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzI1NzItRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekkxTnpJdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11996" - ], - "x-ms-request-id": [ - "4196b7d7-d88d-4bc8-983c-2db6cf2697ed" - ], - "x-ms-correlation-request-id": [ - "4196b7d7-d88d-4bc8-983c-2db6cf2697ed" - ], - "x-ms-routing-request-id": [ - "EASTASIA:20200505T161743Z:4196b7d7-d88d-4bc8-983c-2db6cf2697ed" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:17:43 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-SetApplicationInsightsDailyCap": [ - "pstestrg2572" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestSetPricingPlan.json b/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestSetPricingPlan.json deleted file mode 100644 index 4b43f4564bf0..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/SessionRecords/Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests.PricingAndDailyCapTests/TestSetPricingPlan.json +++ /dev/null @@ -1,1146 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg1330?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMTMzMD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "e0e9f5ed-a8a6-4339-b9cf-c43bd80f3cc2" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "28" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" - ], - "x-ms-request-id": [ - "78015975-645d-4a93-9d7c-74405a936dca" - ], - "x-ms-correlation-request-id": [ - "78015975-645d-4a93-9d7c-74405a936dca" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165717Z:78015975-645d-4a93-9d7c-74405a936dca" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:57:16 GMT" - ], - "Content-Length": [ - "177" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330\",\r\n \"name\": \"pstestrg1330\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", - "StatusCode": 201 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/Microsoft.Insights/components/apppstestrg1330?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMTMzMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcxMzMwP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "29ddae91-151d-4b93-a01e-a64e6e02c5dd" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-failure-cause": [ - "gateway" - ], - "x-ms-request-id": [ - "841da1e6-5ad1-4415-b2c3-2aefa68ae28d" - ], - "x-ms-correlation-request-id": [ - "841da1e6-5ad1-4415-b2c3-2aefa68ae28d" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165721Z:841da1e6-5ad1-4415-b2c3-2aefa68ae28d" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:57:21 GMT" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "161" - ] - }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Insights/components/apppstestrg1330' under resource group 'pstestrg1330' was not found.\"\r\n }\r\n}", - "StatusCode": 404 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/Microsoft.Insights/components/apppstestrg1330?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMTMzMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcxMzMwP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "12baf9c4-6cd0-40c0-9ad6-6686e26dab85" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "12baf9c4-6cd0-40c0-9ad6-6686e26dab85" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11990" - ], - "x-ms-correlation-request-id": [ - "47f7f6d3-69f2-485b-b0d0-4257a619b3b6" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165731Z:47f7f6d3-69f2-485b-b0d0-4257a619b3b6" - ], - "Date": [ - "Tue, 05 May 2020 16:57:30 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/microsoft.insights/components/apppstestrg1330\",\r\n \"name\": \"apppstestrg1330\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"1000adfe-0000-0100-0000-5eb19af80000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg1330\",\r\n \"AppId\": \"c3522fc9-fff2-42ff-bfc7-1f9c83cdd71f\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"5dec63a6-ed19-493d-b9e2-008bec33eb6e\",\r\n \"ConnectionString\": \"InstrumentationKey=5dec63a6-ed19-493d-b9e2-008bec33eb6e\",\r\n \"Name\": \"apppstestrg1330\",\r\n \"CreationDate\": \"2020-05-06T00:57:28.3378427+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/Microsoft.Insights/components/apppstestrg1330?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMTMzMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcxMzMwP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "b5210304-cb4b-4b12-956c-c539c10bc1f1" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "b5210304-cb4b-4b12-956c-c539c10bc1f1" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11986" - ], - "x-ms-correlation-request-id": [ - "fe49ef15-3ba3-46e8-accc-b8e305fdfcc6" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165739Z:fe49ef15-3ba3-46e8-accc-b8e305fdfcc6" - ], - "Date": [ - "Tue, 05 May 2020 16:57:39 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/microsoft.insights/components/apppstestrg1330\",\r\n \"name\": \"apppstestrg1330\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"1000adfe-0000-0100-0000-5eb19af80000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg1330\",\r\n \"AppId\": \"c3522fc9-fff2-42ff-bfc7-1f9c83cdd71f\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"5dec63a6-ed19-493d-b9e2-008bec33eb6e\",\r\n \"ConnectionString\": \"InstrumentationKey=5dec63a6-ed19-493d-b9e2-008bec33eb6e\",\r\n \"Name\": \"apppstestrg1330\",\r\n \"CreationDate\": \"2020-05-06T00:57:28.3378427+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/Microsoft.Insights/components/apppstestrg1330?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMTMzMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcxMzMwP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"kind\": \"web\",\r\n \"properties\": {\r\n \"Application_Type\": \"web\",\r\n \"Request_Source\": \"AzurePowerShell\"\r\n },\r\n \"location\": \"eastus\"\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "26c10848-281c-4955-8295-296e937420f9" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "144" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "26c10848-281c-4955-8295-296e937420f9" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1197" - ], - "x-ms-correlation-request-id": [ - "df77c69b-a827-46f4-8114-d856fe3445d9" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165730Z:df77c69b-a827-46f4-8114-d856fe3445d9" - ], - "Date": [ - "Tue, 05 May 2020 16:57:29 GMT" - ], - "Content-Length": [ - "890" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/microsoft.insights/components/apppstestrg1330\",\r\n \"name\": \"apppstestrg1330\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"1000adfe-0000-0100-0000-5eb19af80000\\\"\",\r\n \"properties\": {\r\n \"Ver\": \"v2\",\r\n \"ApplicationId\": \"apppstestrg1330\",\r\n \"AppId\": \"c3522fc9-fff2-42ff-bfc7-1f9c83cdd71f\",\r\n \"Application_Type\": \"web\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": \"AzurePowerShell\",\r\n \"InstrumentationKey\": \"5dec63a6-ed19-493d-b9e2-008bec33eb6e\",\r\n \"ConnectionString\": \"InstrumentationKey=5dec63a6-ed19-493d-b9e2-008bec33eb6e\",\r\n \"Name\": \"apppstestrg1330\",\r\n \"CreationDate\": \"2020-05-06T00:57:28.3378427+08:00\",\r\n \"TenantId\": \"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/Microsoft.Insights/components/apppstestrg1330/currentbillingfeatures?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMTMzMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcxMzMwL2N1cnJlbnRiaWxsaW5nZmVhdHVyZXM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "cb915e5c-c58a-459a-80b0-1c753731dfed" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "cb915e5c-c58a-459a-80b0-1c753731dfed" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11989" - ], - "x-ms-correlation-request-id": [ - "f4646a48-8204-4e95-ab78-1a3f2ba278fe" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165733Z:f4646a48-8204-4e95-ab78-1a3f2ba278fe" - ], - "Date": [ - "Tue, 05 May 2020 16:57:32 GMT" - ], - "Content-Length": [ - "248" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"CurrentBillingFeatures\": [\r\n \"Basic\"\r\n ],\r\n \"DataVolumeCap\": {\r\n \"Cap\": 100.0,\r\n \"MaxHistoryCap\": 1000.0,\r\n \"ResetTime\": 17,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": false\r\n },\r\n \"EndTime\": \"2018-04-02T21:00:00+08:00\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/Microsoft.Insights/components/apppstestrg1330/currentbillingfeatures?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMTMzMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcxMzMwL2N1cnJlbnRiaWxsaW5nZmVhdHVyZXM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "f6941f6a-1d81-42a8-a94f-f60fddf50886" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "f6941f6a-1d81-42a8-a94f-f60fddf50886" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11987" - ], - "x-ms-correlation-request-id": [ - "614cae8a-2d2b-4104-afe0-309a007c5249" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165735Z:614cae8a-2d2b-4104-afe0-309a007c5249" - ], - "Date": [ - "Tue, 05 May 2020 16:57:34 GMT" - ], - "Content-Length": [ - "248" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"CurrentBillingFeatures\": [\r\n \"Basic\"\r\n ],\r\n \"DataVolumeCap\": {\r\n \"Cap\": 100.0,\r\n \"MaxHistoryCap\": 1000.0,\r\n \"ResetTime\": 17,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": false\r\n },\r\n \"EndTime\": \"2018-04-02T21:00:00+08:00\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/Microsoft.Insights/components/apppstestrg1330/currentbillingfeatures?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMTMzMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcxMzMwL2N1cnJlbnRiaWxsaW5nZmVhdHVyZXM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "b7ccb502-1090-4a68-b3ed-9fefdde793e5" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "b7ccb502-1090-4a68-b3ed-9fefdde793e5" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11985" - ], - "x-ms-correlation-request-id": [ - "52082325-5ee0-4cc1-8c8e-0bd6c89b0415" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165741Z:52082325-5ee0-4cc1-8c8e-0bd6c89b0415" - ], - "Date": [ - "Tue, 05 May 2020 16:57:41 GMT" - ], - "Content-Length": [ - "246" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"CurrentBillingFeatures\": [\r\n \"Basic\"\r\n ],\r\n \"DataVolumeCap\": {\r\n \"Cap\": 300.0,\r\n \"MaxHistoryCap\": 1000.0,\r\n \"ResetTime\": 0,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": true\r\n },\r\n \"EndTime\": \"2018-04-02T21:00:00+08:00\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/Microsoft.Insights/components/apppstestrg1330/quotastatus?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMTMzMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcxMzMwL3F1b3Rhc3RhdHVzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "c9b45850-aaf8-41ea-916b-ba976b909a2e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "c9b45850-aaf8-41ea-916b-ba976b909a2e" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11988" - ], - "x-ms-correlation-request-id": [ - "60043f19-be0f-4524-9c22-577b2e34dae1" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165733Z:60043f19-be0f-4524-9c22-577b2e34dae1" - ], - "Date": [ - "Tue, 05 May 2020 16:57:33 GMT" - ], - "Content-Length": [ - "122" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"InstrumentationKey\": null,\r\n \"AppId\": \"c3522fc9-fff2-42ff-bfc7-1f9c83cdd71f\",\r\n \"ShouldBeThrottled\": false,\r\n \"ExpirationTime\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/Microsoft.Insights/components/apppstestrg1330/quotastatus?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMTMzMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcxMzMwL3F1b3Rhc3RhdHVzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDE=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "86f91bdd-8c0b-4f7d-953b-681829b6126b" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "86f91bdd-8c0b-4f7d-953b-681829b6126b" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11984" - ], - "x-ms-correlation-request-id": [ - "cc435aff-ff5b-49ad-8efb-99d4127af66d" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165741Z:cc435aff-ff5b-49ad-8efb-99d4127af66d" - ], - "Date": [ - "Tue, 05 May 2020 16:57:41 GMT" - ], - "Content-Length": [ - "122" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"InstrumentationKey\": null,\r\n \"AppId\": \"c3522fc9-fff2-42ff-bfc7-1f9c83cdd71f\",\r\n \"ShouldBeThrottled\": false,\r\n \"ExpirationTime\": null\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/Microsoft.Insights/components/apppstestrg1330/currentbillingfeatures?api-version=2015-05-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMTMzMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcxMzMwL2N1cnJlbnRiaWxsaW5nZmVhdHVyZXM/YXBpLXZlcnNpb249MjAxNS0wNS0wMQ==", - "RequestMethod": "PUT", - "RequestBody": "{\r\n \"DataVolumeCap\": {\r\n \"Cap\": 300.0,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": true\r\n },\r\n \"CurrentBillingFeatures\": [\r\n \"Application Insights Enterprise\"\r\n ]\r\n}", - "RequestHeaders": { - "x-ms-client-request-id": [ - "e508ace2-2b51-4988-9cce-19dddd58b94b" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Content-Length": [ - "251" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "e508ace2-2b51-4988-9cce-19dddd58b94b" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1196" - ], - "x-ms-correlation-request-id": [ - "1faa307c-47da-419e-8cfd-a14efe4bd92f" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165739Z:1faa307c-47da-419e-8cfd-a14efe4bd92f" - ], - "Date": [ - "Tue, 05 May 2020 16:57:39 GMT" - ], - "Content-Length": [ - "208" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ], - "Expires": [ - "-1" - ] - }, - "ResponseBody": "{\r\n \"CurrentBillingFeatures\": [\r\n \"Basic\"\r\n ],\r\n \"DataVolumeCap\": {\r\n \"Cap\": 300.0,\r\n \"MaxHistoryCap\": 1000.0,\r\n \"ResetTime\": 0,\r\n \"WarningThreshold\": 90,\r\n \"StopSendNotificationWhenHitThreshold\": false,\r\n \"StopSendNotificationWhenHitCap\": true\r\n }\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/pstestrg1330/providers/Microsoft.Insights/components/apppstestrg1330?api-version=2018-05-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzdGVzdHJnMTMzMC9wcm92aWRlcnMvTWljcm9zb2Z0Lkluc2lnaHRzL2NvbXBvbmVudHMvYXBwcHN0ZXN0cmcxMzMwP2FwaS12ZXJzaW9uPTIwMTgtMDUtMDEtcHJldmlldw==", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "1685a493-0b32-4e88-ad95-6a85d6e5253b" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.ApplicationInsights.Management.ApplicationInsightsManagementClient/0.3.0.0" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-request-id": [ - "1685a493-0b32-4e88-ad95-6a85d6e5253b" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Request-Context": [ - "appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525" - ], - "Access-Control-Expose-Headers": [ - "Request-Context" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14997" - ], - "x-ms-correlation-request-id": [ - "06df7f49-0d81-4ecd-9546-69e2696bb052" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165746Z:06df7f49-0d81-4ecd-9546-69e2696bb052" - ], - "Date": [ - "Tue, 05 May 2020 16:57:46 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/pstestrg1330?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzdGVzdHJnMTMzMD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "x-ms-client-request-id": [ - "cc2ccf87-5aa3-4950-978a-a11f5612a46e" - ], - "Accept-Language": [ - "en-US" - ], - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzEzMzAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-deletes": [ - "14996" - ], - "x-ms-request-id": [ - "7576f3ac-a45e-4d38-98ca-22443a49c132" - ], - "x-ms-correlation-request-id": [ - "7576f3ac-a45e-4d38-98ca-22443a49c132" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165751Z:7576f3ac-a45e-4d38-98ca-22443a49c132" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:57:50 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzEzMzAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekV6TXpBdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzEzMzAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11995" - ], - "x-ms-request-id": [ - "9c9d2cb3-deb5-47e1-83d4-46d48b8085ac" - ], - "x-ms-correlation-request-id": [ - "9c9d2cb3-deb5-47e1-83d4-46d48b8085ac" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165806Z:9c9d2cb3-deb5-47e1-83d4-46d48b8085ac" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:58:05 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzEzMzAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekV6TXpBdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "Location": [ - "https://management.azure.com/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzEzMzAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01" - ], - "Retry-After": [ - "15" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11994" - ], - "x-ms-request-id": [ - "742f0142-c228-4133-a1ea-d6bef431d5d2" - ], - "x-ms-correlation-request-id": [ - "742f0142-c228-4133-a1ea-d6bef431d5d2" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165821Z:742f0142-c228-4133-a1ea-d6bef431d5d2" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:58:21 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 202 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzEzMzAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekV6TXpBdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11993" - ], - "x-ms-request-id": [ - "6d070212-229b-4f9a-8fa5-29d24ea6f4fb" - ], - "x-ms-correlation-request-id": [ - "6d070212-229b-4f9a-8fa5-29d24ea6f4fb" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165837Z:6d070212-229b-4f9a-8fa5-29d24ea6f4fb" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:58:37 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - }, - { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1QU1RFU1RSRzEzMzAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFRVTFSRlUxUlNSekV6TXpBdFJVRlRWRlZUSWl3aWFtOWlURzlqWVhScGIyNGlPaUpsWVhOMGRYTWlmUT9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "User-Agent": [ - "FxVersion/4.6.28207.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.13" - ] - }, - "ResponseHeaders": { - "Cache-Control": [ - "no-cache" - ], - "Pragma": [ - "no-cache" - ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11992" - ], - "x-ms-request-id": [ - "02649141-08d2-482e-ab05-4e04be022634" - ], - "x-ms-correlation-request-id": [ - "02649141-08d2-482e-ab05-4e04be022634" - ], - "x-ms-routing-request-id": [ - "KOREASOUTH:20200505T165838Z:02649141-08d2-482e-ab05-4e04be022634" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Tue, 05 May 2020 16:58:37 GMT" - ], - "Expires": [ - "-1" - ], - "Content-Length": [ - "0" - ] - }, - "ResponseBody": "", - "StatusCode": 200 - } - ], - "Names": { - "Test-SetApplicationInsightsPricingPlan": [ - "pstestrg1330" - ] - }, - "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights.Test/TestController.cs b/src/ApplicationInsights/ApplicationInsights.Test/TestController.cs deleted file mode 100644 index 7f34e3038e7f..000000000000 --- a/src/ApplicationInsights/ApplicationInsights.Test/TestController.cs +++ /dev/null @@ -1,144 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.Common.Authentication; -using Microsoft.Azure.Management.ApplicationInsights.Management; -using Microsoft.Azure.Test.HttpRecorder; -using Microsoft.Rest.ClientRuntime.Azure.TestFramework; -using Microsoft.WindowsAzure.Commands.ScenarioTest; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using Microsoft.Azure.Management.Internal.Resources; -using Microsoft.Azure.Management.Storage; -using TestEnvironmentFactory = Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory; -using Microsoft.Azure.ServiceManagement.Common.Models; - -namespace Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests -{ - public class TestController - { - private readonly EnvironmentSetupHelper _helper; - - public ResourceManagementClient ResourceManagementClient { get; private set; } - - public ApplicationInsightsManagementClient ApplicationInsightsClient { get; private set; } - - public StorageManagementClient StorageManagementClient { get; set; } - - public string UserDomain { get; private set; } - - public static TestController NewInstance => new TestController(); - - public TestController() - { - _helper = new EnvironmentSetupHelper(); - } - - public void RunPsTest(XunitTracingInterceptor logger, params string[] scripts) - { - var sf = new StackTrace().GetFrame(1); - var callingClassType = sf.GetMethod().ReflectedType?.ToString(); - var mockName = sf.GetMethod().Name; - - _helper.TracingInterceptor = logger; - - RunPsTestWorkflow( - () => scripts, - // no custom cleanup - null, - callingClassType, - mockName); - } - - public void RunPsTestWorkflow( - Func scriptBuilder, - Action cleanup, - string callingClassType, - string mockName) - { - var d = new Dictionary - { - {"Microsoft.Resources", null}, - {"Microsoft.Features", null}, - {"Microsoft.Authorization", null}, - {"Microsoft.Storage", null} - }; - var providersToIgnore = new Dictionary - { - {"Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01"} - }; - HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore); - HttpMockServer.RecordsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionRecords"); - - using (var context = MockContext.Start(callingClassType, mockName)) - { - SetupManagementClients(context); - - _helper.SetupEnvironment(AzureModule.AzureResourceManager); - - var callingClassName = callingClassType.Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries).Last(); - _helper.SetupModules(AzureModule.AzureResourceManager, - _helper.RMProfileModule, - _helper.GetRMModulePath("AzureRM.ApplicationInsights.psd1"), - _helper.GetRMModulePath("AzureRM.Storage.psd1"), - "ScenarioTests\\Common.ps1", - "ScenarioTests\\" + callingClassName + ".ps1", - "AzureRM.Resources.ps1"); - - try - { - var psScripts = scriptBuilder?.Invoke(); - if (psScripts != null) - { - _helper.RunPowerShellTest(psScripts); - } - } - finally - { - cleanup?.Invoke(); - } - } - } - - private void SetupManagementClients(MockContext context) - { - ResourceManagementClient = GetResourceManagementClient(context); - ApplicationInsightsClient = GetApplicationInsightsManagementClient(context); - StorageManagementClient = GetStorageManagementClient(context); - - _helper.SetupManagementClients( - ResourceManagementClient, - ApplicationInsightsClient, - StorageManagementClient); - } - - private static ResourceManagementClient GetResourceManagementClient(MockContext context) - { - return context.GetServiceClient(TestEnvironmentFactory.GetTestEnvironment()); - } - - private static ApplicationInsightsManagementClient GetApplicationInsightsManagementClient(MockContext context) - { - return context.GetServiceClient(TestEnvironmentFactory.GetTestEnvironment()); - } - - private StorageManagementClient GetStorageManagementClient(MockContext context) - { - return context.GetServiceClient(TestEnvironmentFactory.GetTestEnvironment()); - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights.sln b/src/ApplicationInsights/ApplicationInsights.sln index 21e736396dea..142feaa08271 100644 --- a/src/ApplicationInsights/ApplicationInsights.sln +++ b/src/ApplicationInsights/ApplicationInsights.sln @@ -7,8 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationInsights", "Appl EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{13BB1C60-A70E-4780-ABEF-D5EE36754085}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationInsights.Test", "ApplicationInsights.Test\ApplicationInsights.Test.csproj", "{D77378FE-D936-4DD8-A82A-3C89A3994A9D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}" @@ -33,10 +31,6 @@ Global {87A51B59-9020-4874-A39B-838C78468E08}.Debug|Any CPU.Build.0 = Debug|Any CPU {87A51B59-9020-4874-A39B-838C78468E08}.Release|Any CPU.ActiveCfg = Release|Any CPU {87A51B59-9020-4874-A39B-838C78468E08}.Release|Any CPU.Build.0 = Release|Any CPU - {D77378FE-D936-4DD8-A82A-3C89A3994A9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D77378FE-D936-4DD8-A82A-3C89A3994A9D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D77378FE-D936-4DD8-A82A-3C89A3994A9D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D77378FE-D936-4DD8-A82A-3C89A3994A9D}.Release|Any CPU.Build.0 = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -69,9 +63,6 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {D77378FE-D936-4DD8-A82A-3C89A3994A9D} = {13BB1C60-A70E-4780-ABEF-D5EE36754085} - EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {591175C5-EDCF-4D1D-80B7-5C2E3C4BFA6F} EndGlobalSection diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/ApplicationInsightsBaseCmdlet.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/ApplicationInsightsBaseCmdlet.cs deleted file mode 100644 index 1a963fa1f009..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/ApplicationInsightsBaseCmdlet.cs +++ /dev/null @@ -1,271 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common; -using Microsoft.Azure.Management.ApplicationInsights.Management; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - public abstract class ApplicationInsightsBaseCmdlet : AzureRMCmdlet - { - private ApplicationInsightsManagementClientWrapper appInsightsManagementClientWrapper; - - protected const string ApplicationInsightsNounStr = "AzureRmApplicationInsights"; - protected const string ApplicationInsightsPricingPlanNounStr = "AzureRmApplicationInsightsPricingPlan"; - protected const string ApplicationInsightsDailyCapNounStr = "AzureRmApplicationInsightsDailyCap"; - protected const string ApplicationInsightsDailyCapStatusNounStr = "AzureRmApplicationInsightsDailyCapStatus"; - protected const string ApplicationInsightsContinuousExportNounStr = "AzureRmApplicationInsightsContinuousExport"; - protected const string ApplicationInsightsApiKeyNounStr = "AzureRmApplicationInsightsApiKey"; - protected const string ApplicationInsightsComponentNameAlias = "ApplicationInsightsComponentName"; - protected const string ComponentNameAlias = "ComponentName"; - protected const string ApplicationKindAlias = "ApplicationKind"; - protected const string TagsAlias = "Tags"; - - protected const string ResourceGroupParameterSet = "ResourceGroupParameterSet"; - protected const string ComponentNameParameterSet = "ComponentNameParameterSet"; - protected const string ComponentObjectParameterSet = "ComponentObjectParameterSet"; - protected const string ResourceIdParameterSet = "ResourceIdParameterSet"; - - public class ApplicationType - { - public const string WEB = "web"; - public const string JAVA = "java"; - public const string NodeJs = "Node.js"; - public const string General = "other"; - } - - public class DocumentTypes - { - public const string Requests = "Request"; - public const string Event = "Custom Event"; - public const string Exceptions = "Exception"; - public const string Metrics = "Metric"; - public const string PageViews = "Page View"; - public const string PageViewPerformance = "Page Load"; - public const string RemoteDependency = "Dependency"; - public const string PerformanceCounters = "Performance Counter"; - public const string Availability = "Availability"; - public const string Messages = "Trace"; - } - - internal class RecordTypes - { - public const string Requests = "Requests"; - public const string Event = "Event"; - public const string Exceptions = "Exceptions"; - public const string Metrics = "Metrics"; - public const string PageViews = "PageViews"; - public const string PageViewPerformance = "PageViewPerformance"; - public const string RemoteDependency = "Rdd"; - public const string PerformanceCounters = "PerformanceCounters"; - public const string Availability = "Availability"; - public const string Messages = "Messages"; - } - - public class PermissionType - { - public const string ReadTelemetry = "ReadTelemetry"; - public const string WriteAnnotations = "WriteAnnotations"; - public const string AuthenticateSDKControlChannel = "AuthenticateSDKControlChannel"; - } - - public class PricingPlans - { - public const string Basic = "Basic"; - public const string Enterprise = "Application Insights Enterprise"; - public const string LimitedBasic = "Limited Basic"; - } - - public IApplicationInsightsManagementClient AppInsightsManagementClient - { - get - { - if (appInsightsManagementClientWrapper == null) - { - appInsightsManagementClientWrapper = new ApplicationInsightsManagementClientWrapper(DefaultProfile.DefaultContext); - } - - this.appInsightsManagementClientWrapper.VerboseLogger = WriteVerboseWithTimestamp; - this.appInsightsManagementClientWrapper.ErrorLogger = WriteErrorWithTimestamp; - return appInsightsManagementClientWrapper.appInsightsManagementClient; - } - - set { appInsightsManagementClientWrapper = new ApplicationInsightsManagementClientWrapper(value); } - } - - public string SubscriptionId - { - get - { - return DefaultProfile.DefaultContext.Subscription.Id.ToString(); - } - } - - protected void WriteCurrentFeatures(ApplicationInsightsComponentBillingFeatures billing) - { - if (billing != null) - { - WriteObject(PSPricingPlan.Create(billing)); - } - } - - protected void WriteDailyCap(ApplicationInsightsComponentBillingFeatures billing) - { - if (billing != null) - { - WriteObject(new PSDailyCap(billing)); - } - } - - protected void WriteComponent(ApplicationInsightsComponent component) - { - if (component != null) - { - WriteObject(PSApplicationInsightsComponent.Create(component)); - } - } - - protected void WriteComponentWithPricingPlan(ApplicationInsightsComponent component, - ApplicationInsightsComponentBillingFeatures billing, - ApplicationInsightsComponentQuotaStatus status) - { - if (component != null && billing != null) - { - WriteObject(new PSApplicationInsightsComponentWithPricingPlan(component, billing, status)); - } - } - - protected void WriteComponentList(IEnumerable components) - { - if (components != null) - { - List output = new List(); - components.ForEach(c => output.Add(new PSApplicationInsightsComponentTableView(c))); - WriteObject(output, true); - } - } - - protected void WriteComponentApiKeys(IEnumerable apiKeys) - { - if (apiKeys != null && apiKeys.Any()) - { - List output = new List(); - apiKeys.ForEach(e => output.Add(new PSApiKeyTableView(e))); - WriteObject(output, true); - } - - } - - protected void WriteComponentApiKey(ApplicationInsightsComponentAPIKey apiKey) - { - if (apiKey != null) - { - WriteObject(new PSApiKey(apiKey)); - } - } - - protected void WriteComponentExportConfiguration(IEnumerable exports) - { - if (exports != null && exports.Any()) - { - List output = new List(); - exports.ForEach(e => output.Add(new PSExportConfigurationTableView(e))); - WriteObject(output, true); - } - } - - protected void WriteComponentExportConfiguration(ApplicationInsightsComponentExportConfiguration export) - { - if (export != null) - { - WriteObject(new PSExportConfiguration(export)); - } - } - - protected void WriteComponentLinkedStorageAccount(ComponentLinkedStorageAccounts linkedStorageAccount) - { - WriteObject(new PSComponentLinkedStorageAccounts(linkedStorageAccount.Id, linkedStorageAccount.Name, linkedStorageAccount.Type, linkedStorageAccount.LinkedStorageAccount)); - } - - protected void WriteDailyCapStatus(ApplicationInsightsComponentQuotaStatus quotaStatus) - { - if (quotaStatus != null) - { - WriteObject(new PSDailyCapStatus(quotaStatus)); - } - } - - protected static string ParseSubscriptionFromId(string idFromServer) - { - if (!string.IsNullOrEmpty(idFromServer)) - { - string[] tokens = idFromServer.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); - - return tokens[1]; - } - - return null; - } - - protected static string[] ConvertToRecordType(string[] documentTypes) - { - if (documentTypes == null) - { - throw new ArgumentNullException("documentTypes"); - } - - Dictionary mapping = new Dictionary(); - mapping.Add(DocumentTypes.Requests.ToLowerInvariant(), RecordTypes.Requests); - mapping.Add(DocumentTypes.Event.ToLowerInvariant(), RecordTypes.Event); - mapping.Add(DocumentTypes.Exceptions.ToLowerInvariant(), RecordTypes.Exceptions); - mapping.Add(DocumentTypes.Messages.ToLowerInvariant(), RecordTypes.Messages); - mapping.Add(DocumentTypes.Metrics.ToLowerInvariant(), RecordTypes.Metrics); - mapping.Add(DocumentTypes.PageViewPerformance.ToLowerInvariant(), RecordTypes.PageViewPerformance); - mapping.Add(DocumentTypes.PageViews.ToLowerInvariant(), RecordTypes.PageViews); - mapping.Add(DocumentTypes.RemoteDependency.ToLowerInvariant(), RecordTypes.RemoteDependency); - mapping.Add(DocumentTypes.Availability.ToLowerInvariant(), RecordTypes.Availability); - mapping.Add(DocumentTypes.PerformanceCounters.ToLowerInvariant(), RecordTypes.PerformanceCounters); - - return documentTypes.Select(d => mapping[d.Trim().ToLowerInvariant()]).ToArray(); - } - - internal static string[] ConvertToDocumentType(string[] recordTypes) - { - if (recordTypes == null) - { - throw new ArgumentNullException("documentTypes"); - } - - Dictionary mapping = new Dictionary(); - mapping.Add(RecordTypes.Requests.ToLowerInvariant(), DocumentTypes.Requests); - mapping.Add(RecordTypes.Event.ToLowerInvariant(), DocumentTypes.Event); - mapping.Add(RecordTypes.Exceptions.ToLowerInvariant(), DocumentTypes.Exceptions); - mapping.Add(RecordTypes.Messages.ToLowerInvariant(), DocumentTypes.Messages); - mapping.Add(RecordTypes.Metrics.ToLowerInvariant(), DocumentTypes.Metrics); - mapping.Add(RecordTypes.PageViewPerformance.ToLowerInvariant(), DocumentTypes.PageViewPerformance); - mapping.Add(RecordTypes.PageViews.ToLowerInvariant(), DocumentTypes.PageViews); - mapping.Add(RecordTypes.RemoteDependency.ToLowerInvariant(), DocumentTypes.RemoteDependency); - mapping.Add(RecordTypes.Availability.ToLowerInvariant(), DocumentTypes.Availability); - mapping.Add(RecordTypes.PerformanceCounters.ToLowerInvariant(), DocumentTypes.PerformanceCounters); - - return recordTypes.Select(d => mapping[d.Trim().ToLowerInvariant()]).ToArray(); - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/ApplicationInsightsManagementClient.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/ApplicationInsightsManagementClient.cs deleted file mode 100644 index 125c624b02a9..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/ApplicationInsightsManagementClient.cs +++ /dev/null @@ -1,45 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.Common.Authentication; -using Microsoft.Azure.Commands.Common.Authentication.Abstractions; -using Microsoft.Azure.Management.ApplicationInsights.Management; -using System; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - public partial class ApplicationInsightsManagementClientWrapper - { - public IApplicationInsightsManagementClient appInsightsManagementClient { get; set; } - - public Action VerboseLogger { get; set; } - - public Action ErrorLogger { get; set; } - - public ApplicationInsightsManagementClientWrapper(IAzureContext context) - : this(AzureSession - .Instance - .ClientFactory - .CreateArmClient( - context, - AzureEnvironment.Endpoint.ResourceManager)) - { - } - - public ApplicationInsightsManagementClientWrapper(IApplicationInsightsManagementClient resourceManagementClient) - { - appInsightsManagementClient = resourceManagementClient; - } - } -} \ No newline at end of file diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsights.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsights.cs deleted file mode 100644 index cb22843304b0..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsights.cs +++ /dev/null @@ -1,129 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [GenericBreakingChange("API version bump up to 2020-02-02, output type will be also updated to match the new API version", "2.0.0")] - [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsights", DefaultParameterSetName = ResourceGroupParameterSet), OutputType(typeof(PSApplicationInsightsComponent))] - public class GetApplicationInsightsCommand : ApplicationInsightsBaseCmdlet - { - [Parameter( - Position = 0, - Mandatory = false, - ParameterSetName = ResourceGroupParameterSet, - HelpMessage = "Resource Group Name.")] - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Application Insights Resource Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ResourceIdParameterSet, - ValueFromPipelineByPropertyName = true, - HelpMessage = "Application Insights Component Resource Id.")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Mandatory = false, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "If specified, it will get back pricing plan/daily cap and status of the application insights component.")] - [Parameter( - Mandatory = false, - ParameterSetName = ResourceIdParameterSet, - HelpMessage = "If specified, it will get back pricing plan/daily cap and status of the application insights component.")] - [Alias("IncludeDailyCap", "IncludeDailyCapStatus", "IncludePricingPlan")] - public SwitchParameter Full { get; set; } - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (!string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.Name = identifier.ResourceName; - } - - if (string.IsNullOrEmpty(this.ResourceGroupName)) - { - var components = Utilities.GetComponents(this.AppInsightsManagementClient); - - WriteComponentList(components); - } - else if (string.IsNullOrEmpty(this.Name)) - { - var components = Utilities.GetComponents(this.AppInsightsManagementClient, this.ResourceGroupName); - - WriteComponentList(components); - } - else - { - var response = this.AppInsightsManagementClient - .Components - .GetWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name) - .GetAwaiter() - .GetResult(); - if (this.Full) - { - var pricingPlanResponse = this.AppInsightsManagementClient - .ComponentCurrentBillingFeatures - .GetWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name) - .GetAwaiter() - .GetResult(); - - var dailyCapStatusResponse = this.AppInsightsManagementClient - .ComponentQuotaStatus - .GetWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name) - .GetAwaiter() - .GetResult(); - - WriteComponentWithPricingPlan(response.Body, pricingPlanResponse.Body, dailyCapStatusResponse.Body); - } - else - { - WriteComponent(response.Body); - } - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsightsApiKey.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsightsApiKey.cs deleted file mode 100644 index 7a10de33d920..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsightsApiKey.cs +++ /dev/null @@ -1,116 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [GenericBreakingChange("Output type will be updated to match API 2015-05-01", "2.0.0")] - [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsApiKey", DefaultParameterSetName = ComponentNameParameterSet), OutputType(typeof(PSApiKey))] - public class GetApplicationInsightsApiKeyCommand : ApplicationInsightsBaseCmdlet - { - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentObjectParameterSet, - ValueFromPipeline = true, - HelpMessage = "Application Insights Component Object.")] - [CmdletParameterBreakingChange("ApplicationInsightsComponent", ChangeDescription = "Parameter ApplicationInsightsComponent will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNull] - public PSApplicationInsightsComponent ApplicationInsightsComponent { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ResourceIdParameterSet, - ValueFromPipelineByPropertyName = true, - HelpMessage = "Application Insights Component Resource Id.")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Application Insights Component Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Position = 2, - Mandatory = false, - HelpMessage = "Application Insights Api Key Id.")] - [ValidateNotNullOrEmpty] - public string ApiKeyId { get; set; } - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.ApplicationInsightsComponent != null) - { - this.ResourceGroupName = this.ApplicationInsightsComponent.ResourceGroupName; - this.Name = this.ApplicationInsightsComponent.Name; - } - - if (!string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.Name = identifier.ResourceName; - } - - if (string.IsNullOrEmpty(this.ApiKeyId)) - { - var apiKeyResponse = this.AppInsightsManagementClient - .APIKeys - .ListWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name) - .GetAwaiter() - .GetResult(); - - WriteComponentApiKeys(apiKeyResponse.Body); - } - else - { - var apiKeyResponse = this.AppInsightsManagementClient - .APIKeys - .GetWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name, - this.ApiKeyId) - .GetAwaiter() - .GetResult(); - - WriteComponentApiKey(apiKeyResponse.Body); - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsightsContinuousExport.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsightsContinuousExport.cs deleted file mode 100644 index 3d3f8cad1f47..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsightsContinuousExport.cs +++ /dev/null @@ -1,116 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [GenericBreakingChange("Output type will be updated to match API 2015-05-01", "2.0.0")] - [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsContinuousExport", DefaultParameterSetName = ComponentNameParameterSet), OutputType(typeof(PSExportConfiguration))] - public class GetApplicationInsightsContinuousExportCommand : ApplicationInsightsBaseCmdlet - { - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentObjectParameterSet, - ValueFromPipeline = true, - HelpMessage = "Application Insights Component Object.")] - [CmdletParameterBreakingChange("ApplicationInsightsComponent", ChangeDescription = "Parameter ApplicationInsightsComponent will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNull] - public PSApplicationInsightsComponent ApplicationInsightsComponent { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ResourceIdParameterSet, - ValueFromPipelineByPropertyName = true, - HelpMessage = "Application Insights Component Resource Id.")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Application Insights Component Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Position = 2, - Mandatory = false, - HelpMessage = "Application Insights Continuous Export Id.")] - [ValidateNotNullOrEmpty] - public string ExportId { get; set; } - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.ApplicationInsightsComponent != null) - { - this.ResourceGroupName = this.ApplicationInsightsComponent.ResourceGroupName; - this.Name = this.ApplicationInsightsComponent.Name; - } - - if (!string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.Name = identifier.ResourceName; - } - - if (string.IsNullOrEmpty(this.ExportId)) - { - var exportConfigurationsResponse = this.AppInsightsManagementClient - .ExportConfigurations - .ListWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name) - .GetAwaiter() - .GetResult(); - - WriteComponentExportConfiguration(exportConfigurationsResponse.Body); - } - else - { - var exportConfigurationResponse = this.AppInsightsManagementClient - .ExportConfigurations - .GetWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name, - this.ExportId) - .GetAwaiter() - .GetResult(); - - WriteComponentExportConfiguration(exportConfigurationResponse.Body); - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsightsLinkedStorageAccount.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsightsLinkedStorageAccount.cs deleted file mode 100644 index ebda9093530d..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/GetApplicationInsightsLinkedStorageAccount.cs +++ /dev/null @@ -1,95 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.Rest.Azure; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights -{ - [GenericBreakingChange("Output type will be updated to match API 2020-03-01-preview", "2.0.0")] - [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsLinkedStorageAccount", DefaultParameterSetName = ByResourceNameParameterSet), OutputType(typeof(PSComponentLinkedStorageAccounts))] - public class GetApplicationInsightsLinkedStorageAccount : ApplicationInsightsBaseCmdlet - { - internal const string ByResourceNameParameterSet = "ByResourceNameParameterSet"; - internal const string ByInputObjectParameterSet = "ByInputObjectParameterSet"; - internal const string ByResourceIdParameterSet = "ByResourceIdParameterSet"; - - #region Cmdlet parameters - - [Parameter( - ParameterSetName = ByResourceNameParameterSet, - Mandatory = true, - HelpMessage = "Resource Group Name")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - ParameterSetName = ByResourceNameParameterSet, - Mandatory = true, - HelpMessage = "Component Name")] - [ValidateNotNullOrEmpty] - public string ComponentName { get; set; } - - [Parameter( - ParameterSetName = ByInputObjectParameterSet, - Mandatory = true, - ValueFromPipeline = true, - HelpMessage = "PSApplicationInsightsComponent")] - [CmdletParameterBreakingChange("InputObject", ChangeDescription = "Parameter InputObject will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public PSApplicationInsightsComponent InputObject { get; set; } - - [Parameter( - ParameterSetName = ByResourceIdParameterSet, - Mandatory = true, - HelpMessage = "Component ResourceId")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - #endregion - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.IsParameterBound(c => c.InputObject)) - { - this.ResourceId = this.InputObject.Id; - } - - if (this.IsParameterBound(c => c.ResourceId) || !string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.ComponentName = identifier.ResourceName; - } - - ComponentLinkedStorageAccounts response = this.AppInsightsManagementClient - .ComponentLinkedStorageAccounts - .GetWithHttpMessagesAsync(this.ResourceGroupName, this.ComponentName) - .GetAwaiter() - .GetResult() - .Body; - WriteComponentLinkedStorageAccount(response); - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsights.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsights.cs deleted file mode 100644 index 81dc6d30c68a..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsights.cs +++ /dev/null @@ -1,157 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Commands.ResourceManager.Common.Tags; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.Rest.Azure; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System.Collections; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [GenericBreakingChange("API version bump up to 2020-02-02, output type will be also updated to match the new API version", "2.0.0")] - [Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsights", SupportsShouldProcess = true), OutputType(typeof(PSApplicationInsightsComponent))] - public class NewAzureApplicationInsights : ApplicationInsightsBaseCmdlet - { - #region Cmdlet parameters - - [Parameter( - Position = 0, - Mandatory = true, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - HelpMessage = "Application Insights Resource Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Position = 2, - Mandatory = true, - HelpMessage = "Application Insights Resource Location.")] - [LocationCompleter("Microsoft.Insights/components")] - [ValidateNotNullOrEmpty] - public string Location { get; set; } - - [Parameter( - Position = 3, - Mandatory = false, - HelpMessage = "Retention In Days, 90 by default.")] - [ValidateNotNull] - public int? RetentionInDays; - - [Parameter( - Position = 4, - Mandatory = false, - HelpMessage = "The network access type for accessing Application Insights ingestion. Value should be 'Enabled' or 'Disabled'")] - public string PublicNetworkAccessForIngestion; - - [Parameter( - Position = 5, - Mandatory = false, - HelpMessage = "The network access type for accessing Application Insights query. Value should be 'Enabled' or 'Disabled'")] - public string PublicNetworkAccessForQuery; - - [Parameter( - Mandatory = false, - HelpMessage = "Application kind.")] - [Alias(ApplicationKindAlias)] - [ValidateSet(ApplicationType.WEB, - ApplicationType.General, - ApplicationType.NodeJs, - ApplicationType.JAVA, - IgnoreCase = true)] - [PSDefaultValue(Value = ApplicationType.WEB)] - public string Kind - { - get - { - return kind; - } - set - { - this.kind = value; - } - } - private string kind = ApplicationType.WEB; - - [Parameter( - Mandatory = false, - HelpMessage = "Component Tags.")] - [ValidateNotNull] - [Alias(TagsAlias)] - public Hashtable Tag { get; set; } - - #endregion - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - ApplicationInsightsComponent existingComponent = null; - try - { - existingComponent = this.AppInsightsManagementClient - .Components - .GetWithHttpMessagesAsync(ResourceGroupName, Name) - .GetAwaiter() - .GetResult() - .Body; - } - catch (CloudException) - { - existingComponent = null; - } - - if (existingComponent != null) - { - throw new System.ArgumentException($"component {Name} already existing in Resource Group {ResourceGroupName}"); - } - - ApplicationInsightsComponent newComponentProperties = new ApplicationInsightsComponent() - { - Location = this.Location, - Kind = this.Kind, - ApplicationType = Kind, - Tags = TagsConversionHelper.CreateTagDictionary(this.Tag, validate: true), - RequestSource = "AzurePowerShell", - RetentionInDays = this.RetentionInDays == null ? null : this.RetentionInDays, - PublicNetworkAccessForIngestion = this.PublicNetworkAccessForIngestion, - PublicNetworkAccessForQuery = this.PublicNetworkAccessForQuery - }; - - if (this.ShouldProcess(this.ResourceGroupName, $"Create Application Insights Component {this.Name}")) - { - var newComponentResponse = this.AppInsightsManagementClient - .Components - .CreateOrUpdateWithHttpMessagesAsync( - ResourceGroupName, - Name, - newComponentProperties) - .Result; - - this.WriteComponent(newComponentResponse.Body); - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsightsApiKey.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsightsApiKey.cs deleted file mode 100644 index 30a00820f370..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsightsApiKey.cs +++ /dev/null @@ -1,123 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [GenericBreakingChange("Output type will be updated to match API 2015-05-01", "2.0.0")] - [Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsApiKey", DefaultParameterSetName = ComponentNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSApiKey))] - public class NewAzureApplicationInsightsApiKeyCommand : ApplicationInsightsBaseCmdlet - { - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentObjectParameterSet, - ValueFromPipeline = true, - HelpMessage = "Application Insights Component Object.")] - [ValidateNotNull] - [CmdletParameterBreakingChange("ApplicationInsightsComponent", ChangeDescription = "Parameter ApplicationInsightsComponent will be removed in upcoming Az.ApplicationInsights 2.0.0")] - public PSApplicationInsightsComponent ApplicationInsightsComponent { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ResourceIdParameterSet, - ValueFromPipelineByPropertyName = true, - HelpMessage = "Application Insights Component Resource Id.")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Component Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Position = 2, - Mandatory = true, - HelpMessage = "Permissions that API key allow apps to do.")] - [ValidateSet(PermissionType.ReadTelemetry, - PermissionType.WriteAnnotations, - PermissionType.AuthenticateSDKControlChannel, - IgnoreCase = true)] - public string[] Permissions { get; set; } - - [Parameter( - Position = 3, - Mandatory = true, - HelpMessage = "Description to help identify this API key.")] - [ValidateNotNullOrEmpty] - public string Description { get; set; } - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.ApplicationInsightsComponent != null) - { - this.ResourceGroupName = this.ApplicationInsightsComponent.ResourceGroupName; - this.Name = this.ApplicationInsightsComponent.Name; - } - - if (!string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.Name = identifier.ResourceName; - } - - APIKeyRequest apiKeyRequest = new APIKeyRequest(); - apiKeyRequest.Name = this.Description; - - var access = PSApiKey.BuildApiKeyAccess(this.SubscriptionId, this.ResourceGroupName, this.Name, this.Permissions); - apiKeyRequest.LinkedReadProperties = access.Item1; - apiKeyRequest.LinkedWriteProperties = access.Item2; - - if (this.ShouldProcess(this.Name, $"Create Api Key '{this.Description}'")) - { - var apiKeyResponse = this.AppInsightsManagementClient - .APIKeys - .CreateWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name, - apiKeyRequest) - .GetAwaiter() - .GetResult(); - - WriteComponentApiKey(apiKeyResponse.Body); - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsightsContinuousExport.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsightsContinuousExport.cs deleted file mode 100644 index 1d39687b9167..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsightsContinuousExport.cs +++ /dev/null @@ -1,154 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System.Linq; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [GenericBreakingChange("Output type will be updated to match API 2015-05-01", "2.0.0")] - [Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsContinuousExport", DefaultParameterSetName = ComponentNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSExportConfiguration))] - public class NewAzureApplicationInsightsContinuousExportCommand : ApplicationInsightsBaseCmdlet - { - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentObjectParameterSet, - ValueFromPipeline = true, - HelpMessage = "Application Insights Component Object.")] - [CmdletParameterBreakingChange("ApplicationInsightsComponent", ChangeDescription = "Parameter ApplicationInsightsComponent will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNull] - public PSApplicationInsightsComponent ApplicationInsightsComponent { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ResourceIdParameterSet, - ValueFromPipelineByPropertyName = true, - HelpMessage = "Application Insights Component Resource Id.")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Component Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Mandatory = true, - HelpMessage = "Document types that need exported.")] - [ValidateSet(ApplicationInsightsBaseCmdlet.DocumentTypes.Requests, - ApplicationInsightsBaseCmdlet.DocumentTypes.Exceptions, - ApplicationInsightsBaseCmdlet.DocumentTypes.Event, - ApplicationInsightsBaseCmdlet.DocumentTypes.Messages, - ApplicationInsightsBaseCmdlet.DocumentTypes.Metrics, - ApplicationInsightsBaseCmdlet.DocumentTypes.PageViewPerformance, - ApplicationInsightsBaseCmdlet.DocumentTypes.PageViews, - ApplicationInsightsBaseCmdlet.DocumentTypes.RemoteDependency, - ApplicationInsightsBaseCmdlet.DocumentTypes.Availability, - ApplicationInsightsBaseCmdlet.DocumentTypes.PerformanceCounters, - IgnoreCase = true)] - public string[] DocumentType { get; set; } - - [Parameter( - Mandatory = true, - HelpMessage = "Destination Storage Account Id.")] - [ValidateNotNullOrEmpty] - public string StorageAccountId { get; set; } - - [Parameter( - Mandatory = true, - HelpMessage = "Destination Storage Location Id.")] - [ValidateNotNullOrEmpty] - public string StorageLocation { get; set; } - - [Parameter( - Mandatory = true, - HelpMessage = "Destination Storage SAS Uri.")] - [ValidateNotNullOrEmpty] - public string StorageSASUri { get; set; } - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.ApplicationInsightsComponent != null) - { - this.ResourceGroupName = this.ApplicationInsightsComponent.ResourceGroupName; - this.Name = this.ApplicationInsightsComponent.Name; - } - - if (!string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.Name = identifier.ResourceName; - } - - ApplicationInsightsComponentExportRequest exportRequest = new ApplicationInsightsComponentExportRequest(); - exportRequest.IsEnabled = "true"; - exportRequest.DestinationAccountId = this.StorageAccountId; - exportRequest.DestinationStorageSubscriptionId = ParseSubscriptionFromId(this.StorageAccountId); - exportRequest.DestinationAddress = this.StorageSASUri; - exportRequest.DestinationStorageLocationId = this.StorageLocation; - exportRequest.DestinationType = "Blob"; - exportRequest.RecordTypes = string.Join(",", ConvertToRecordType(this.DocumentType)); - - if (this.ShouldProcess(this.Name, "Create Application Insights Continuous Export")) - { - try - { - var exportConfigurationsResponse = this.AppInsightsManagementClient - .ExportConfigurations - .CreateWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name, - exportRequest) - .GetAwaiter() - .GetResult(); - - WriteComponentExportConfiguration(exportConfigurationsResponse.Body.FirstOrDefault()); - } - catch (Microsoft.Rest.Azure.CloudException exception) - { - if (exception.Response != null && exception.Response.StatusCode == System.Net.HttpStatusCode.Conflict) - { - throw new System.Exception("There is already an export defined for this destination."); - } - - throw exception; - } - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsightsLinkedStorageAccount.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsightsLinkedStorageAccount.cs deleted file mode 100644 index d8a2003741f6..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/NewApplicationInsightsLinkedStorageAccount.cs +++ /dev/null @@ -1,128 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.Rest; -using Microsoft.Rest.Azure; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights -{ - [GenericBreakingChange("Output type will be updated to match API 2020-03-01-Preview", "2.0.0")] - [Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsLinkedStorageAccount", DefaultParameterSetName = ByResourceNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSComponentLinkedStorageAccounts))] - public class NewApplicationInsightsLinkedStorageAccount : ApplicationInsightsBaseCmdlet - { - internal const string ByResourceNameParameterSet = "ByResourceNameParameterSet"; - internal const string ByInputObjectParameterSet = "ByInputObjectParameterSet"; - internal const string ByResourceIdParameterSet = "ByResourceIdParameterSet"; - - #region Cmdlet parameters - - [Parameter( - ParameterSetName = ByResourceNameParameterSet, - Mandatory = true, - HelpMessage = "Resource Group Name")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - ParameterSetName = ByResourceNameParameterSet, - Mandatory = true, - HelpMessage = "Component Name")] - [ValidateNotNullOrEmpty] - public string ComponentName { get; set; } - - [Parameter( - ParameterSetName = ByInputObjectParameterSet, - Mandatory = true, - ValueFromPipeline = true, - HelpMessage = "PSApplicationInsightsComponent")] - [CmdletParameterBreakingChange("InputObject", ChangeDescription = "Parameter InputObject will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public PSApplicationInsightsComponent InputObject { get; set; } - - [Parameter( - ParameterSetName = ByResourceIdParameterSet, - Mandatory = true, - HelpMessage = "Component ResourceId")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Mandatory = true, - HelpMessage = "Storage Account ResourceId")] - [ValidateNotNullOrEmpty] - public string LinkedStorageAccountResourceId { get; set; } - - #endregion - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - string StorageAccount = new ResourceIdentifier(this.LinkedStorageAccountResourceId).ResourceName; - - if (this.IsParameterBound(c => c.InputObject)) - { - this.ResourceId = this.InputObject.Id; - } - - if (this.IsParameterBound(c => c.ResourceId) || !string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.ComponentName = identifier.ResourceName; - } - - ComponentLinkedStorageAccounts existingLinkedStorageAccount = null; - - try - { - existingLinkedStorageAccount = this.AppInsightsManagementClient - .ComponentLinkedStorageAccounts - .GetWithHttpMessagesAsync(this.ResourceGroupName, this.ComponentName) - .GetAwaiter() - .GetResult() - .Body; - } - catch (RestException) - { - existingLinkedStorageAccount = null; - } - - if (existingLinkedStorageAccount != null) - { - throw new System.ArgumentException($"Storage Account: {StorageAccount} is already linked to component: {this.ComponentName}"); - } - - if (this.ShouldProcess(this.ResourceGroupName, $"Link Storage Account: {StorageAccount} to Application Insights Component {this.ComponentName}")) - { - ComponentLinkedStorageAccounts response = this.AppInsightsManagementClient - .ComponentLinkedStorageAccounts - .CreateAndUpdateWithHttpMessagesAsync(this.ResourceGroupName, this.ComponentName, this.LinkedStorageAccountResourceId) - .GetAwaiter() - .GetResult() - .Body; - WriteComponentLinkedStorageAccount(response); - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsights.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsights.cs deleted file mode 100644 index aeb6f3b4d5bc..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsights.cs +++ /dev/null @@ -1,102 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsights", DefaultParameterSetName = ComponentNameParameterSet, SupportsShouldProcess = true)] - [OutputType(typeof(bool))] - public class RemoveApplicationInsightsComponent : ApplicationInsightsBaseCmdlet - { - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentObjectParameterSet, - ValueFromPipeline = true, - HelpMessage = "Application Insights Component Object.")] - [CmdletParameterBreakingChange("ApplicationInsightsComponent", ChangeDescription = "Type of ApplicationInsightsComponent will be updated to match API 2020-02-02 in Az.ApplicationInsights 2.0.0")] - [ValidateNotNull] - public PSApplicationInsightsComponent ApplicationInsightsComponent { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ResourceIdParameterSet, - ValueFromPipelineByPropertyName = true, - HelpMessage = "Application Insights Component Resource Id.")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter 'ResourceId' will be removed and please use it in such way: '$resourceid | Remove-AzApplicationInsights' in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Application Insights Component Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Mandatory = false, - HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] - public SwitchParameter PassThru { get; set; } - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.ApplicationInsightsComponent != null) - { - this.ResourceGroupName = this.ApplicationInsightsComponent.ResourceGroupName; - this.Name = this.ApplicationInsightsComponent.Name; - } - - if (!string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.Name = identifier.ResourceName; - } - - if (ShouldProcess(this.Name, "Remove Application Insights Component")) - { - this.AppInsightsManagementClient.Components.DeleteWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name) - .GetAwaiter() - .GetResult(); - - if (this.PassThru) - { - WriteObject(true); - } - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsightsApiKey.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsightsApiKey.cs deleted file mode 100644 index fa93bdbb4fdf..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsightsApiKey.cs +++ /dev/null @@ -1,113 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsApiKey", DefaultParameterSetName = ComponentNameParameterSet, SupportsShouldProcess = true)] - [OutputType(typeof(bool))] - public class RemoveApplicationComponentInsightsApiKey : ApplicationInsightsBaseCmdlet - { - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentObjectParameterSet, - ValueFromPipeline = true, - HelpMessage = "Application Insights Component Object.")] - [CmdletParameterBreakingChange("ApplicationInsightsComponent", ChangeDescription = "Parameter ApplicationInsightsComponent will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNull] - public PSApplicationInsightsComponent ApplicationInsightsComponent { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ResourceIdParameterSet, - ValueFromPipelineByPropertyName = true, - HelpMessage = "Application Insights Component Resource Id.")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Application Insights Component Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Position = 2, - Mandatory = true, - HelpMessage = "Application Insights API Key ID.")] - [ValidateNotNullOrEmpty] - public string ApiKeyId { get; set; } - - [Parameter( - Mandatory = false, - HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] - public SwitchParameter PassThru { get; set; } - - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.ApplicationInsightsComponent != null) - { - this.ResourceGroupName = this.ApplicationInsightsComponent.ResourceGroupName; - this.Name = this.ApplicationInsightsComponent.Name; - } - - if (!string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.Name = identifier.ResourceName; - } - - if (ShouldProcess(this.Name, "Remove Application Insights API key")) - { - this.AppInsightsManagementClient - .APIKeys - .DeleteWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name, - this.ApiKeyId) - .GetAwaiter() - .GetResult(); - - if (this.PassThru) - { - WriteObject(true); - } - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsightsContinuousExport.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsightsContinuousExport.cs deleted file mode 100644 index a9dd809f184e..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsightsContinuousExport.cs +++ /dev/null @@ -1,112 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsContinuousExport", DefaultParameterSetName = ComponentNameParameterSet, SupportsShouldProcess = true)] - [OutputType(typeof(bool))] - public class RemoveApplicationInsightsComponentContinuousExport : ApplicationInsightsBaseCmdlet - { - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentObjectParameterSet, - ValueFromPipeline = true, - HelpMessage = "Application Insights Component Object.")] - [CmdletParameterBreakingChange("ApplicationInsightsComponent", ChangeDescription = "Parameter ApplicationInsightsComponent will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNull] - public PSApplicationInsightsComponent ApplicationInsightsComponent { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ResourceIdParameterSet, - ValueFromPipelineByPropertyName = true, - HelpMessage = "Application Insights Component Resource Id.")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Application Insights Component Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Position = 2, - Mandatory = true, - HelpMessage = "Application Insights Continuous Export ID.")] - [ValidateNotNullOrEmpty] - public string ExportId { get; set; } - - [Parameter( - Mandatory = false, - HelpMessage = "If specified will write true in case operation succeeds. This parameter is optional. Default value is false.")] - public SwitchParameter PassThru { get; set; } - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.ApplicationInsightsComponent != null) - { - this.ResourceGroupName = this.ApplicationInsightsComponent.ResourceGroupName; - this.Name = this.ApplicationInsightsComponent.Name; - } - - if (!string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.Name = identifier.ResourceName; - } - - if (ShouldProcess(this.Name, "Remove Application Insights Continuous Export")) - { - this.AppInsightsManagementClient - .ExportConfigurations - .DeleteWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name, - this.ExportId) - .GetAwaiter() - .GetResult(); - - if (this.PassThru) - { - WriteObject(true); - } - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsightsLinkedStorageAccount.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsightsLinkedStorageAccount.cs deleted file mode 100644 index f592867ceb57..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/RemoveApplicationInsightsLinkedStorageAccount.cs +++ /dev/null @@ -1,96 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.Rest.Azure; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights -{ - [Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsLinkedStorageAccount", DefaultParameterSetName = ByResourceNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(bool))] - public class RemoveApplicationInsightsLinkedStorageAccount : ApplicationInsightsBaseCmdlet - { - internal const string ByResourceNameParameterSet = "ByResourceNameParameterSet"; - internal const string ByInputObjectParameterSet = "ByInputObjectParameterSet"; - internal const string ByResourceIdParameterSet = "ByResourceIdParameterSet"; - - #region Cmdlet parameters - - [Parameter( - ParameterSetName = ByResourceNameParameterSet, - Mandatory = true, - HelpMessage = "Resource Group Name")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - ParameterSetName = ByResourceNameParameterSet, - Mandatory = true, - HelpMessage = "Component Name")] - [ValidateNotNullOrEmpty] - public string ComponentName { get; set; } - - [Parameter( - ParameterSetName = ByInputObjectParameterSet, - Mandatory = true, - ValueFromPipeline = true, - HelpMessage = "PSApplicationInsightsComponent")] - [CmdletParameterBreakingChange("InputObject", ChangeDescription = "Parameter InputObject will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public PSApplicationInsightsComponent InputObject { get; set; } - - [Parameter( - ParameterSetName = ByResourceIdParameterSet, - Mandatory = true, - HelpMessage = "Component ResourceId")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - #endregion - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.IsParameterBound(c => c.InputObject)) - { - this.ResourceId = this.InputObject.Id; - } - - if (this.IsParameterBound(c => c.ResourceId) || !string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.ComponentName = identifier.ResourceName; - } - - if (this.ShouldProcess(this.ResourceGroupName, $"Remove Linked Storage Account for Application Insights Component {this.ComponentName}")) - { - var response = this.AppInsightsManagementClient - .ComponentLinkedStorageAccounts - .DeleteWithHttpMessagesAsync(this.ResourceGroupName, this.ComponentName) - .GetAwaiter() - .GetResult(); - - WriteObject(true); - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/SetApplicationInsightsContinuousExport.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/SetApplicationInsightsContinuousExport.cs deleted file mode 100644 index 917f234e4a17..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/SetApplicationInsightsContinuousExport.cs +++ /dev/null @@ -1,161 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [GenericBreakingChange("Output type will be updated to match API 2015-05-01", "2.0.0")] - [Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsContinuousExport", DefaultParameterSetName = ComponentNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSExportConfiguration))] - public class SetApplicationInsightsContinuousExportCommand : ApplicationInsightsBaseCmdlet - { - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentObjectParameterSet, - ValueFromPipeline = true, - HelpMessage = "Application Insights Component Object.")] - [CmdletParameterBreakingChange("ApplicationInsightsComponent", ChangeDescription = "Parameter ApplicationInsightsComponent will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNull] - public PSApplicationInsightsComponent ApplicationInsightsComponent { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ResourceIdParameterSet, - ValueFromPipelineByPropertyName = true, - HelpMessage = "Application Insights Component Resource Id.")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Application Insights Component Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Mandatory = true, - HelpMessage = "Application Insights Continuous Export Id.")] - [ValidateNotNullOrEmpty] - public string ExportId { get; set; } - - [Parameter( - Mandatory = true, - HelpMessage = "Document types that need exported.")] - [ValidateSet(ApplicationInsightsBaseCmdlet.DocumentTypes.Requests, - ApplicationInsightsBaseCmdlet.DocumentTypes.Exceptions, - ApplicationInsightsBaseCmdlet.DocumentTypes.Event, - ApplicationInsightsBaseCmdlet.DocumentTypes.Messages, - ApplicationInsightsBaseCmdlet.DocumentTypes.Metrics, - ApplicationInsightsBaseCmdlet.DocumentTypes.PageViewPerformance, - ApplicationInsightsBaseCmdlet.DocumentTypes.PageViews, - ApplicationInsightsBaseCmdlet.DocumentTypes.RemoteDependency, - ApplicationInsightsBaseCmdlet.DocumentTypes.Availability, - ApplicationInsightsBaseCmdlet.DocumentTypes.PerformanceCounters, - IgnoreCase = true)] - public string[] DocumentType { get; set; } - - [Parameter( - Mandatory = true, - HelpMessage = "Destination Storage Account Id.")] - [ValidateNotNullOrEmpty] - public string StorageAccountId { get; set; } - - [Parameter( - Mandatory = true, - HelpMessage = "Destination Storage Location Id.")] - [ValidateNotNullOrEmpty] - public string StorageLocation { get; set; } - - [Parameter( - Mandatory = true, - HelpMessage = "Destination Storage SAS uri.")] - [ValidateNotNullOrEmpty] - public string StorageSASUri { get; set; } - - [Parameter( - Mandatory = false, - HelpMessage = "Disable continuous export or not.")] - [PSDefaultValue(Value = true)] - public SwitchParameter DisableConfiguration { get; set; } - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.ApplicationInsightsComponent != null) - { - this.ResourceGroupName = this.ApplicationInsightsComponent.ResourceGroupName; - this.Name = this.ApplicationInsightsComponent.Name; - } - - if (!string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.Name = identifier.ResourceName; - } - - ApplicationInsightsComponentExportRequest exportRequest = new ApplicationInsightsComponentExportRequest(); - if (this.DisableConfiguration) - { - exportRequest.IsEnabled = "false"; - } - else - { - exportRequest.IsEnabled = "true"; - } - exportRequest.DestinationAccountId = this.StorageAccountId; - exportRequest.DestinationStorageSubscriptionId = ParseSubscriptionFromId(this.StorageAccountId); - exportRequest.DestinationAddress = this.StorageSASUri; - exportRequest.DestinationStorageLocationId = this.StorageLocation; - exportRequest.DestinationType = "Blob"; - exportRequest.RecordTypes = string.Join(",", ConvertToRecordType(this.DocumentType)); - - if (this.ShouldProcess(this.Name, $"Update Application Insights Continuous Export {this.ExportId}")) - { - var exportResponse = this.AppInsightsManagementClient - .ExportConfigurations - .UpdateWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name, - this.ExportId, - exportRequest) - .GetAwaiter() - .GetResult(); - - WriteComponentExportConfiguration(exportResponse.Body); - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/SetApplicationInsightsDailyCap.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/SetApplicationInsightsDailyCap.cs deleted file mode 100644 index 0de0542e79f9..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/SetApplicationInsightsDailyCap.cs +++ /dev/null @@ -1,132 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [GenericBreakingChange("Output type will be updated to match API 2015-05-01", "2.0.0")] - [Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsDailyCap", DefaultParameterSetName = ComponentNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSPricingPlan))] - public class SetApplicationInsightsDailyCapCommand : ApplicationInsightsBaseCmdlet - { - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentObjectParameterSet, - ValueFromPipeline = true, - HelpMessage = "Application Insights Component Object.")] - [CmdletParameterBreakingChange("ApplicationInsightsComponent", ChangeDescription = "Parameter ApplicationInsightsComponent will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNull] - public PSApplicationInsightsComponent ApplicationInsightsComponent { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ResourceIdParameterSet, - ValueFromPipelineByPropertyName = true, - HelpMessage = "Application Insights Component Resource Id.")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Application Insights Component Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Mandatory = false, - HelpMessage = "Daily Cap.")] - public double? DailyCapGB { get; set; } - - [Parameter( - Mandatory = false, - HelpMessage = "Stop send notification when hit cap.")] - public SwitchParameter DisableNotificationWhenHitCap { get; set; } - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.ApplicationInsightsComponent != null) - { - this.ResourceGroupName = this.ApplicationInsightsComponent.ResourceGroupName; - this.Name = this.ApplicationInsightsComponent.Name; - } - - if (!string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.Name = identifier.ResourceName; - } - - ApplicationInsightsComponentBillingFeatures features = - this.AppInsightsManagementClient - .ComponentCurrentBillingFeatures - .GetWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name) - .GetAwaiter() - .GetResult() - .Body; - - if (this.DailyCapGB != null) - { - features.DataVolumeCap.Cap = this.DailyCapGB.Value; - } - - if (this.DisableNotificationWhenHitCap) - { - features.DataVolumeCap.StopSendNotificationWhenHitCap = true; - } - else - { - features.DataVolumeCap.StopSendNotificationWhenHitCap = false; - } - - if (this.ShouldProcess(this.Name, "Update Daily Cap")) - { - var putResponse = this.AppInsightsManagementClient - .ComponentCurrentBillingFeatures - .UpdateWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name, - features) - .GetAwaiter() - .GetResult(); - - WriteDailyCap(putResponse.Body); - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/SetApplicationInsightsPricingPlan.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/SetApplicationInsightsPricingPlan.cs deleted file mode 100644 index 48d0b4dc619b..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/SetApplicationInsightsPricingPlan.cs +++ /dev/null @@ -1,157 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - [GenericBreakingChange("Output type will be updated to match API 2015-05-01", "2.0.0")] - [Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsPricingPlan", DefaultParameterSetName = ComponentNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSPricingPlan))] - public class SetApplicationInsightsPricingPlanCommand : ApplicationInsightsBaseCmdlet - { - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentObjectParameterSet, - ValueFromPipeline = true, - HelpMessage = "Application Insights Component Object.")] - [CmdletParameterBreakingChange("ApplicationInsightsComponent", ChangeDescription = "Parameter ApplicationInsightsComponent will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNull] - public PSApplicationInsightsComponent ApplicationInsightsComponent { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ResourceIdParameterSet, - ValueFromPipelineByPropertyName = true, - HelpMessage = "Application Insights Component Resource Id.")] - [CmdletParameterBreakingChange("ResourceId", ChangeDescription = "Parameter ResourceId will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Position = 0, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - ParameterSetName = ComponentNameParameterSet, - HelpMessage = "Application Insights Component Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Mandatory = false, - HelpMessage = "Pricing plan name.")] - [ValidateSet(PricingPlans.Basic, - PricingPlans.Enterprise, - PricingPlans.LimitedBasic, - IgnoreCase = true)] - [ValidateNotNullOrEmpty] - public string PricingPlan { get; set; } - - [Parameter( - Mandatory = false, - HelpMessage = "Daily Cap.")] - public double? DailyCapGB { get; set; } - - [Parameter( - Mandatory = false, - HelpMessage = "Stop send notification when hit cap.")] - public SwitchParameter DisableNotificationWhenHitCap { get; set; } - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - if (this.ApplicationInsightsComponent != null) - { - this.ResourceGroupName = this.ApplicationInsightsComponent.ResourceGroupName; - this.Name = this.ApplicationInsightsComponent.Name; - } - - if (!string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.Name = identifier.ResourceName; - } - - ApplicationInsightsComponentBillingFeatures features = - this.AppInsightsManagementClient - .ComponentCurrentBillingFeatures - .GetWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name) - .GetAwaiter() - .GetResult() - .Body; - if (!string.IsNullOrEmpty(this.PricingPlan)) - { - if (this.PricingPlan.ToLowerInvariant().Contains("enterprise")) - { - features.CurrentBillingFeatures = new string[] { "Application Insights Enterprise" }; - } - else if (this.PricingPlan.ToLowerInvariant().Contains("limited")) - { - features.CurrentBillingFeatures = new string[] { "Limited Basic" }; - } - else - { - features.CurrentBillingFeatures = new string[] { "Basic" }; - } - } - - if (this.DailyCapGB != null) - { - features.DataVolumeCap.Cap = this.DailyCapGB.Value; - } - - if (this.DisableNotificationWhenHitCap.IsPresent) - { - features.DataVolumeCap.StopSendNotificationWhenHitCap = true; - } - else - { - features.DataVolumeCap.StopSendNotificationWhenHitCap = false; - } - - if (this.ShouldProcess(this.Name, "Update Pricing Plan")) - { - var putResponse = this.AppInsightsManagementClient - .ComponentCurrentBillingFeatures - .UpdateWithHttpMessagesAsync( - this.ResourceGroupName, - this.Name, - features) - .GetAwaiter() - .GetResult(); - - WriteCurrentFeatures(putResponse.Body); - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/UpdateApplicationInsights.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/UpdateApplicationInsights.cs deleted file mode 100644 index eb176cbc8b36..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/UpdateApplicationInsights.cs +++ /dev/null @@ -1,125 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Commands.ResourceManager.Common.Tags; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.Rest.Azure; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using System.Collections; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights -{ - public class UpdateApplicationInsights - { - [GenericBreakingChange("API version bump up to 2020-02-02, output type will be also updated to match the new API version", "2.0.0")] - [Cmdlet("Update", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsights", SupportsShouldProcess = true), OutputType(typeof(PSApplicationInsightsComponent))] - public class UpdateAzureApplicationInsights : ApplicationInsightsBaseCmdlet - { - #region Cmdlet parameters - - [Parameter( - Position = 0, - Mandatory = true, - HelpMessage = "Resource Group Name.")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - Position = 1, - Mandatory = true, - HelpMessage = "Application Insights Resource Name.")] - [Alias(ApplicationInsightsComponentNameAlias, ComponentNameAlias)] - [ValidateNotNullOrEmpty] - public string Name { get; set; } - - [Parameter( - Position = 2, - Mandatory = false, - HelpMessage = "Retention In Days, 90 by default.")] - [ValidateNotNull] - public int? RetentionInDays; - - [Parameter( - Position = 3, - Mandatory = false, - HelpMessage = "The network access type for accessing Application Insights ingestion. Value should be 'Enabled' or 'Disabled'")] - public string PublicNetworkAccessForIngestion; - - [Parameter( - Position = 3, - Mandatory = false, - HelpMessage = "The network access type for accessing Application Insights query. Value should be 'Enabled' or 'Disabled'")] - public string PublicNetworkAccessForQuery; - - [Parameter( - Mandatory = false, - HelpMessage = "Component Tags.")] - [ValidateNotNull] - [Alias(TagsAlias)] - public Hashtable Tag { get; set; } - - #endregion - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - ApplicationInsightsComponent existingComponent = null; - try - { - existingComponent = this.AppInsightsManagementClient - .Components - .GetWithHttpMessagesAsync(ResourceGroupName, Name) - .GetAwaiter() - .GetResult() - .Body; - } - catch (CloudException) - { - throw new System.ArgumentException($"component {Name} is not existed in Resource Group {ResourceGroupName}"); - } - - ApplicationInsightsComponent newComponentProperties = new ApplicationInsightsComponent() - { - Location = existingComponent.Location, - Kind = existingComponent.Kind, - ApplicationType = existingComponent.Kind, - Tags = TagsConversionHelper.CreateTagDictionary(this.Tag, validate: true), - RequestSource = "AzurePowerShell", - RetentionInDays = this.IsParameterBound(c => c.RetentionInDays) ? this.RetentionInDays : existingComponent.RetentionInDays, - PublicNetworkAccessForIngestion = this.IsParameterBound(c => c.PublicNetworkAccessForIngestion) ? this.PublicNetworkAccessForIngestion : existingComponent.PublicNetworkAccessForIngestion, - PublicNetworkAccessForQuery = this.IsParameterBound(c => c.PublicNetworkAccessForQuery) ? this.PublicNetworkAccessForQuery : existingComponent.PublicNetworkAccessForQuery - }; - - if (this.ShouldProcess(this.ResourceGroupName, $"Update Application Insights Component {this.Name}")) - { - var newComponentResponse = this.AppInsightsManagementClient - .Components - .CreateOrUpdateWithHttpMessagesAsync( - ResourceGroupName, - Name, - newComponentProperties) - .Result; - - this.WriteComponent(newComponentResponse.Body); - } - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/UpdateApplicationInsightsLinkedStorageAccount.cs b/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/UpdateApplicationInsightsLinkedStorageAccount.cs deleted file mode 100644 index 9164dd071f20..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/ApplicationInsights/UpdateApplicationInsightsLinkedStorageAccount.cs +++ /dev/null @@ -1,121 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using Microsoft.Azure.Commands.ApplicationInsights.Models; -using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; -using Microsoft.Rest.Azure; -using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using System.Management.Automation; - -namespace Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights -{ - [GenericBreakingChange("Output type will be updated to match API 2020-03-01-Preview", "2.0.0")] - [Cmdlet("Update", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApplicationInsightsLinkedStorageAccount", DefaultParameterSetName = ByResourceNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSComponentLinkedStorageAccounts))] - public class UpdateApplicationInsightsLinkedStorageAccount : ApplicationInsightsBaseCmdlet - { - internal const string ByResourceNameParameterSet = "ByResourceNameParameterSet"; - internal const string ByInputObjectParameterSet = "ByInputObjectParameterSet"; - internal const string ByResourceIdParameterSet = "ByResourceIdParameterSet"; - - #region Cmdlet parameters - - [Parameter( - ParameterSetName = ByResourceNameParameterSet, - Mandatory = true, - HelpMessage = "Resource Group Name")] - [ResourceGroupCompleter] - [ValidateNotNullOrEmpty] - public string ResourceGroupName { get; set; } - - [Parameter( - ParameterSetName = ByResourceNameParameterSet, - Mandatory = true, - HelpMessage = "Component Name")] - [ValidateNotNullOrEmpty] - public string ComponentName { get; set; } - - [Parameter( - ParameterSetName = ByInputObjectParameterSet, - Mandatory = true, - ValueFromPipeline = true, - HelpMessage = "PSApplicationInsightsComponent")] - [CmdletParameterBreakingChange("InputObject", ChangeDescription = "Parameter InputObject will be removed in upcoming Az.ApplicationInsights 2.0.0")] - [ValidateNotNullOrEmpty] - public PSApplicationInsightsComponent InputObject { get; set; } - - [Parameter( - ParameterSetName = ByResourceIdParameterSet, - Mandatory = true, - HelpMessage = "Component ResourceId")] - [ValidateNotNullOrEmpty] - public string ResourceId { get; set; } - - [Parameter( - Mandatory = true, - HelpMessage = "Storage Account ResourceId")] - [ValidateNotNullOrEmpty] - public string LinkedStorageAccountResourceId { get; set; } - - #endregion - - public override void ExecuteCmdlet() - { - base.ExecuteCmdlet(); - - string StorageAccount = new ResourceIdentifier(this.LinkedStorageAccountResourceId).ResourceName; - - if (this.IsParameterBound(c => c.InputObject)) - { - this.ResourceId = this.InputObject.Id; - } - - if (this.IsParameterBound(c => c.ResourceId) || !string.IsNullOrEmpty(this.ResourceId)) - { - ResourceIdentifier identifier = new ResourceIdentifier(this.ResourceId); - this.ResourceGroupName = identifier.ResourceGroupName; - this.ComponentName = identifier.ResourceName; - } - - ComponentLinkedStorageAccounts existingLinkedStorageAccount = null; - - try - { - existingLinkedStorageAccount = this.AppInsightsManagementClient - .ComponentLinkedStorageAccounts - .GetWithHttpMessagesAsync(this.ResourceGroupName, this.ComponentName) - .GetAwaiter() - .GetResult() - .Body; - } - catch (CloudException) - { - throw new System.ArgumentException($"Component: {this.ComponentName} Does Not Have a Linked Stoprage Account"); - } - - if (this.ShouldProcess(this.ResourceGroupName, $"Update Linked Storage Account: {StorageAccount} to Application Insights Component {this.ComponentName}")) - { - ComponentLinkedStorageAccounts response = this.AppInsightsManagementClient - .ComponentLinkedStorageAccounts - .UpdateWithHttpMessagesAsync(this.ResourceGroupName, this.ComponentName, this.LinkedStorageAccountResourceId) - .GetAwaiter() - .GetResult() - .Body; - WriteComponentLinkedStorageAccount(response); - } - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/Az.ApplicationInsights.psd1 b/src/ApplicationInsights/ApplicationInsights/Az.ApplicationInsights.psd1 index 19b6c9e25ef6..f20ce5c7afe6 100644 --- a/src/ApplicationInsights/ApplicationInsights/Az.ApplicationInsights.psd1 +++ b/src/ApplicationInsights/ApplicationInsights/Az.ApplicationInsights.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 3/31/2022 +# Generated on: 5/10/2022 # @{ @@ -79,27 +79,28 @@ FunctionsToExport = 'Get-AzApplicationInsightsWebTest', 'New-AzApplicationInsightsWebTestGeolocationObject', 'New-AzApplicationInsightsWebTestHeaderFieldObject', 'Remove-AzApplicationInsightsWebTest', - 'Update-AzApplicationInsightsWebTestTag' - -# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. -CmdletsToExport = 'Get-AzApplicationInsights', 'New-AzApplicationInsights', - 'Remove-AzApplicationInsights', 'Update-AzApplicationInsights', - 'Set-AzApplicationInsightsPricingPlan', - 'Set-AzApplicationInsightsDailyCap', + 'Update-AzApplicationInsightsWebTestTag', + 'Get-AzApplicationInsights', 'Get-AzApplicationInsightsApiKey', 'Get-AzApplicationInsightsContinuousExport', - 'Set-AzApplicationInsightsContinuousExport', + 'Get-AzApplicationInsightsLinkedStorageAccount', + 'New-AzApplicationInsights', 'New-AzApplicationInsightsApiKey', 'New-AzApplicationInsightsContinuousExport', - 'Remove-AzApplicationInsightsContinuousExport', - 'Get-AzApplicationInsightsApiKey', - 'New-AzApplicationInsightsApiKey', + 'New-AzApplicationInsightsLinkedStorageAccount', + 'Remove-AzApplicationInsights', 'Remove-AzApplicationInsightsApiKey', - 'Get-AZApplicationInsightsLinkedStorageAccount', - 'New-AZApplicationInsightsLinkedStorageAccount', - 'Update-AZApplicationInsightsLinkedStorageAccount', - 'Remove-AZApplicationInsightsLinkedStorageAccount' + 'Remove-AzApplicationInsightsContinuousExport', + 'Remove-AzApplicationInsightsLinkedStorageAccount', + 'Set-AzApplicationInsightsContinuousExport', + 'Set-AzApplicationInsightsDailyCap', + 'Set-AzApplicationInsightsPricingPlan', + 'Set-AzApplicationInsightsWebTest', 'Update-AzApplicationInsights', + 'Update-AzApplicationInsightsLinkedStorageAccount' + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = @() # Variables to export from this module -# VariablesToExport = @() +VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = @() @@ -119,7 +120,7 @@ PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. - Tags = 'Azure','ResourceManager','ARM','ApplicationInsights' + Tags = 'Azure', 'ResourceManager', 'ARM', 'ApplicationInsights' # A URL to the license for this module. LicenseUri = 'https://raw.githubusercontent.com/Azure/azure-powershell/dev/LICENSE.txt' @@ -144,7 +145,7 @@ PrivateData = @{ } # End of PSData hashtable - } # End of PrivateData hashtable +} # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' diff --git a/src/ApplicationInsights/ApplicationInsights/ChangeLog.md b/src/ApplicationInsights/ApplicationInsights/ChangeLog.md index 3dec6dd697a4..9fcb273e2d0e 100644 --- a/src/ApplicationInsights/ApplicationInsights/ChangeLog.md +++ b/src/ApplicationInsights/ApplicationInsights/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* **[Breaking change]** Upgraded API version for ApplicationInsights component to 2020-02-02 ## Version 1.3.1 * Added breaking change warnings for upcoming Az.ApplicationInsights 2.0.0 diff --git a/src/ApplicationInsights/ApplicationInsights/Helper/Utilities.cs b/src/ApplicationInsights/ApplicationInsights/Helper/Utilities.cs deleted file mode 100644 index e09256b74082..000000000000 --- a/src/ApplicationInsights/ApplicationInsights/Helper/Utilities.cs +++ /dev/null @@ -1,106 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// 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. -// ---------------------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Runtime.Serialization; -using System.Security.Cryptography; -using Microsoft.Rest.Azure; -using Microsoft.Azure.Management.ApplicationInsights.Management.Models; -using Microsoft.Azure.Management.ApplicationInsights.Management; - -namespace Microsoft.Azure.Commands.ApplicationInsights -{ - /// - /// Class to define Utility methods - /// - internal static class Utilities - { - internal static List GetComponents(IApplicationInsightsManagementClient applicationInsightsClient) - { - Func> listAsync = - () => applicationInsightsClient - .Components - .ListWithHttpMessagesAsync() - .GetAwaiter() - .GetResult() - .Body; - - Func> listNextAsync = - nextLink => applicationInsightsClient - .Components - .ListNextWithHttpMessagesAsync( - nextLink) - .GetAwaiter() - .GetResult() - .Body; - - return Utilities.GetPagedList(listAsync, listNextAsync); - } - - internal static List GetComponents(IApplicationInsightsManagementClient applicationInsightsClient, string resourceGroupName) - { - Func> listAsync = - () => applicationInsightsClient - .Components - .ListByResourceGroupWithHttpMessagesAsync(resourceGroupName) - .GetAwaiter() - .GetResult() - .Body; - - Func> listNextAsync = - nextLink => applicationInsightsClient - .Components - .ListByResourceGroupNextWithHttpMessagesAsync( - nextLink) - .GetAwaiter() - .GetResult() - .Body; - - return Utilities.GetPagedList(listAsync, listNextAsync); - } - - - internal static List GetPagedList(Func> listResources, Func> listNext) - where T : class - { - var resources = new List(); - string nextLink = null; - - var pagedResources = listResources(); - - foreach (var pagedResource in pagedResources) - { - resources.Add(pagedResource); - } - - nextLink = pagedResources.NextPageLink; - - while (!string.IsNullOrEmpty(nextLink)) - { - pagedResources = listNext(nextLink); - nextLink = pagedResources.NextPageLink; - - foreach (var pagedResource in pagedResources) - { - resources.Add(pagedResource); - } - } - - return resources; - } - } -} diff --git a/src/ApplicationInsights/ApplicationInsights/help/Az.ApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights/help/Az.ApplicationInsights.md index 400f38465474..4af50e2990bc 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Az.ApplicationInsights.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Az.ApplicationInsights.md @@ -1,81 +1,86 @@ --- Module Name: Az.ApplicationInsights -Module Guid: da67eaa7-4cb1-4bfa-a194-8bf3faae8ac6 -Download Help Link: https://docs.microsoft.com/powershell/module/az.applicationinsights -Help Version: 0.1.2.0 -Locale: en-US +Module Guid: {{ Update Module Guid }} +Download Help Link: {{ Update Download Link }} +Help Version: {{ Update Help Version }} +Locale: {{ Update Locale }} --- # Az.ApplicationInsights Module ## Description -Creates and manages application insights in Azure Resource Manager. +{{ Fill in the Description }} ## Az.ApplicationInsights Cmdlets ### [Get-AzApplicationInsights](Get-AzApplicationInsights.md) -Get application insights resources +Returns an Application Insights component. ### [Get-AzApplicationInsightsApiKey](Get-AzApplicationInsightsApiKey.md) -Get application insights api keys for an application insights resource +Get the API Key for this key id. ### [Get-AzApplicationInsightsContinuousExport](Get-AzApplicationInsightsContinuousExport.md) -Get application insights continuous export configuration for an application insights resource +Get the Continuous Export configuration for this export id. ### [Get-AzApplicationInsightsLinkedStorageAccount](Get-AzApplicationInsightsLinkedStorageAccount.md) -Get application insights linked storage account +Returns the current linked storage settings for an Application Insights component. + +### [Get-AzApplicationInsightsWebTest](Get-AzApplicationInsightsWebTest.md) +Get a specific Application Insights web test definition. ### [New-AzApplicationInsights](New-AzApplicationInsights.md) -Create a new application insights resource +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. ### [New-AzApplicationInsightsApiKey](New-AzApplicationInsightsApiKey.md) -Create an application insights api key for an application insights resource +Create an API Key of an Application Insights component. ### [New-AzApplicationInsightsContinuousExport](New-AzApplicationInsightsContinuousExport.md) -Create a new application insights continuous export configuration for an application insights resource +Create a Continuous Export configuration of an Application Insights component. ### [New-AzApplicationInsightsLinkedStorageAccount](New-AzApplicationInsightsLinkedStorageAccount.md) -Create an application insights linked storage account +Replace current linked storage account for an Application Insights component. + +### [New-AzApplicationInsightsWebTest](New-AzApplicationInsightsWebTest.md) +Creates or updates an Application Insights web test definition. + +### [New-AzApplicationInsightsWebTestGeolocationObject](New-AzApplicationInsightsWebTestGeolocationObject.md) +Create an in-memory object for WebTestGeolocation. + +### [New-AzApplicationInsightsWebTestHeaderFieldObject](New-AzApplicationInsightsWebTestHeaderFieldObject.md) +Create a in-memory object for HeaderField ### [Remove-AzApplicationInsights](Remove-AzApplicationInsights.md) -Remove an application insights resource +Deletes an Application Insights component. ### [Remove-AzApplicationInsightsApiKey](Remove-AzApplicationInsightsApiKey.md) -Remove an application insights api key for an application insights resource +Delete an API Key of an Application Insights component. ### [Remove-AzApplicationInsightsContinuousExport](Remove-AzApplicationInsightsContinuousExport.md) -Remove a continuous export configuration in an application insights resource +Delete a Continuous Export configuration of an Application Insights component. ### [Remove-AzApplicationInsightsLinkedStorageAccount](Remove-AzApplicationInsightsLinkedStorageAccount.md) -Delete application insights linked storage account +Delete linked storage accounts for an Application Insights component. + +### [Remove-AzApplicationInsightsWebTest](Remove-AzApplicationInsightsWebTest.md) +Deletes an Application Insights web test. ### [Set-AzApplicationInsightsContinuousExport](Set-AzApplicationInsightsContinuousExport.md) -Update a continuous export configuration in an application insights resource +Create a Continuous Export configuration of an Application Insights component. ### [Set-AzApplicationInsightsDailyCap](Set-AzApplicationInsightsDailyCap.md) -Set daily data volume cap for an application insights resource +Update current billing features for an Application Insights component. ### [Set-AzApplicationInsightsPricingPlan](Set-AzApplicationInsightsPricingPlan.md) -Set pricing plan and daily data volume information for an application insights resource - -### [Update-AzApplicationInsights](Update-AzApplicationInsights.md) -update an existing application insights resource - -### [Update-AzApplicationInsightsLinkedStorageAccount](Update-AzApplicationInsightsLinkedStorageAccount.md) -Update application insights linked storage account - -### [Get-AzApplicationInsightsWebTest](Get-AzApplicationInsightsWebTest.md) -Get a specific Application Insights web test definition. +Update current billing features for an Application Insights component. -### [New-AzApplicationInsightsWebTest](New-AzApplicationInsightsWebTest.md) +### [Set-AzApplicationInsightsWebTest](Set-AzApplicationInsightsWebTest.md) Creates or updates an Application Insights web test definition. -### [New-AzApplicationInsightsWebTestGeolocationObject](New-AzApplicationInsightsWebTestGeolocationObject.md) -Create an in-memory object for WebTestGeolocation. - -### [New-AzApplicationInsightsWebTestHeaderFieldObject](New-AzApplicationInsightsWebTestHeaderFieldObject.md) -Create a in-memory object for HeaderField +### [Update-AzApplicationInsights](Update-AzApplicationInsights.md) +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. -### [Remove-AzApplicationInsightsWebTest](Remove-AzApplicationInsightsWebTest.md) -Deletes an Application Insights web test. +### [Update-AzApplicationInsightsLinkedStorageAccount](Update-AzApplicationInsightsLinkedStorageAccount.md) +Update linked storage accounts for an Application Insights component. ### [Update-AzApplicationInsightsWebTestTag](Update-AzApplicationInsightsWebTestTag.md) Creates or updates an Application Insights web test definition. diff --git a/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsights.md index 58ddb4b92b5b..e7ec13386796 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsights.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsights.md @@ -1,109 +1,73 @@ --- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights -online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponent schema: 2.0.0 --- # Get-AzApplicationInsights ## SYNOPSIS -Get application insights resources +Returns an Application Insights component. ## SYNTAX -### ResourceGroupParameterSet (Default) +### ListBySubscription (Default) ``` -Get-AzApplicationInsights [[-ResourceGroupName] ] [-DefaultProfile ] +Get-AzApplicationInsights [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzApplicationInsights [-SubscriptionId ] -ResourceGroupName -Name [-Full] + [-DefaultProfile ] [] +``` + +### ListByResourceGroupName +``` +Get-AzApplicationInsights [-SubscriptionId ] -ResourceGroupName [-DefaultProfile ] [] ``` -### ComponentNameParameterSet +### GetByResourceId ``` -Get-AzApplicationInsights [-ResourceGroupName] [-Name] [-Full] - [-DefaultProfile ] [] +Get-AzApplicationInsights -ResourceId [-Full] [-DefaultProfile ] [] ``` -### ResourceIdParameterSet +### GetByInputObject ``` -Get-AzApplicationInsights [-ResourceId] [-Full] [-DefaultProfile ] +Get-AzApplicationInsights -InputObject [-DefaultProfile ] [] ``` ## DESCRIPTION -Get application insights resources in a resource group or specific resource +Returns an Application Insights component. ## EXAMPLES -### Example 1 Get application insights resource +### Example 1: Get application insights resource ```powershell -Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -``` -```output -Id : /subscriptions/{subid}/resourceGroups/testgroup/providers/microsoft.insights/components/test -ResourceGroupName : testgroup -Name : test -Kind : web -Location : eastus -Type : microsoft.insights/components -AppId : 7c8f0641-d307-41bc-b8f2-d30701adb4b3 -ApplicationType : web -Tags : {} -CreationDate : 7/5/2017 4:37:22 PM -FlowType : Redfield -HockeyAppId : -HockeyAppToken : -InstrumentationKey : 1e30d092-4b4b-47c6-ad39-7c10785d80f5 -ProvisioningState : Succeeded -RequestSource : IbizaAIExtension -SamplingPercentage : -TenantId : b90b0dec-9b9a-4778-a84e-4ffb73bb17f7 -``` - -Get application insights resource named "test" in resource group "testgroup" - -### Example 2 Get application insights resource with pricing plan information +PS C:\> Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" +``` + +Get application insights resource + +### Example 2: Get application insights resource with pricing plan information ```powershell -Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePricingPlan -``` -```output -Cap : 330 -ResetTime : 0 -StopSendNotificationWhenHitCap : True -CapExpirationTime : -IsCapped : False -Id : /subscriptions/{subid}/resourceGroups/testgroup/providers/microsoft.insights/components/test -ResourceGroupName : testgroup -Name : test -Kind : web -Location : eastus -Type : microsoft.insights/components -AppId : 7c8f0641-d307-41bc-b8f2-d30701adb4b3 -ApplicationType : web -Tags : {} -CreationDate : 7/5/2017 4:37:22 PM -FlowType : Redfield -HockeyAppId : -HockeyAppToken : -InstrumentationKey : 1e30d092-4b4b-47c6-ad39-7c10785d80f5 -ProvisioningState : Succeeded -RequestSource : IbizaAIExtension -SamplingPercentage : -TenantId : b90b0dec-9b9a-4778-a84e-4ffb73bb17f7 -PricingPlan : Basic -``` - -Get application insights resource and include pricing plan information for resource named "test" in resource group "testgroup" +PS C:\> Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePricingPlan +``` + +Get application insights resource with pricing plan information ## PARAMETERS ### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.Management.Automation.PSObject Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: AzureRMContext, AzureCredential Required: False Position: Named @@ -113,11 +77,10 @@ Accept wildcard characters: False ``` ### -Full -If specified, it will get back pricing plan/daily cap and status of the application insights component. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: ComponentNameParameterSet, ResourceIdParameterSet +Parameter Sets: Get, GetByResourceId Aliases: IncludeDailyCap, IncludeDailyCapStatus, IncludePricingPlan Required: False @@ -127,60 +90,80 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: GetByInputObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -Name -Application Insights Resource Name. +The name of the Application Insights component resource. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: Get Aliases: ApplicationInsightsComponentName, ComponentName Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name. +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ResourceGroupParameterSet +Parameter Sets: Get, ListByResourceGroupName Aliases: -Required: False -Position: 0 +Required: True +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` +### -ResourceId +The resource ID of applicationinsights component. + ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: GetByResourceId Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Application Insights Component Resource Id. +### -SubscriptionId +The ID of the target subscription. ```yaml -Type: System.String -Parameter Sets: ResourceIdParameterSet +Type: System.String[] +Parameter Sets: ListBySubscription, Get, ListByResourceGroupName Aliases: -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False Accept wildcard characters: False ``` @@ -189,12 +172,34 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### System.String +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan ## NOTES +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsApiKey.md b/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsApiKey.md index a2d69f0cf2e2..79a554360e5e 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsApiKey.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsApiKey.md @@ -1,5 +1,5 @@ ---- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +--- +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsapikey schema: 2.0.0 @@ -8,167 +8,173 @@ schema: 2.0.0 # Get-AzApplicationInsightsApiKey ## SYNOPSIS -Get application insights api keys for an application insights resource +Get the API Key for this key id. ## SYNTAX -### ComponentNameParameterSet (Default) +### List (Default) ``` -Get-AzApplicationInsightsApiKey [-ResourceGroupName] [-Name] [[-ApiKeyId] ] - [-DefaultProfile ] [] +Get-AzApplicationInsightsApiKey -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] ``` -### ComponentObjectParameterSet +### Get ``` -Get-AzApplicationInsightsApiKey [-ApplicationInsightsComponent] - [[-ApiKeyId] ] [-DefaultProfile ] [] +Get-AzApplicationInsightsApiKey -ApiKeyId -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] ``` -### ResourceIdParameterSet +### GetViaIdentity ``` -Get-AzApplicationInsightsApiKey [-ResourceId] [[-ApiKeyId] ] - [-DefaultProfile ] [] +Get-AzApplicationInsightsApiKey -InputObject [-DefaultProfile ] + [] ``` ## DESCRIPTION -Get application insights api keys for an application insights resource +Get the API Key for this key id. ## EXAMPLES -### Example 1 Get Api Keys for an application insights resource +### Example 1: Get Api Keys for an application insights resource ```powershell -Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -``` -```output -Id Description Permissions CreatedDate ApiKey --- ----------- ----------- ----------- ------ -7c4c61dc-b392-4aa4-992f-ee92b84e5dee test1 ReadTelemetry Wed, 18 Oct 2017 23:36:40 GMT -63657030-dea6-4c52-82f4-6f5128cb92cb test2 {ReadTelemetry, WriteAnnotations} Wed, 18 Oct 2017 21:46:41 GMT -82549f39-f3ae-492e-8f94-f7aada75fa57 test3 ReadTelemetry Wed, 18 Oct 2017 22:30:23 GMT +PS C:\> Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" ``` -Get application insights api keys for resource "test" in resource group "testGroup". +Get Api Keys for an application insights resource -### Example 2 Get specific API key for an application insights resource +### Example 2: Get specific API key for an application insights resource ```powershell -Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId 7c4c61dc-b392-4aa4-992f-ee92b84e5dee -``` -```output -ApiKey : -CreatedDate : Wed, 18 Oct 2017 23:36:40 GMT -Id : 7c4c61dc-b392-4aa4-992f-ee92b84e5dee -Permissions : {ReadTelemetry} -Description : test1 +PS C:\> Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId 7c4c61dc-b392-4aa4-992f-ee92b84e5dee ``` -Get specific application insights api key that id is "7c4c61dc-b392-4aa4-992f-e -e92b84e5dee" for resource "test" in resource group "testGroup". +Get specific API key for an application insights resource ## PARAMETERS ### -ApiKeyId -Application Insights Api Key Id. +The API Key ID. +This is unique within a Application Insights component. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: Get Aliases: -Required: False -Position: 2 +Required: True +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ApplicationInsightsComponent -Application Insights Component Object. +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ComponentObjectParameterSet -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True -Position: 0 +Required: False +Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` -### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer -Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: GetViaIdentity +Aliases: -Required: False +Required: True Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` ### -Name -Application Insights Component Name. +The name of the Application Insights component resource. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: List, Get Aliases: ApplicationInsightsComponentName, ComponentName Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name. +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: List, Get Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Application Insights Component Resource Id. +### -SubscriptionId +The ID of the target subscription. ```yaml -Type: System.String -Parameter Sets: ResourceIdParameterSet +Type: System.String[] +Parameter Sets: List, Get Aliases: -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent - -### System.String +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApiKey +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey ## NOTES +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsContinuousExport.md index ae5ec04045b6..9f1ef0b273e3 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsContinuousExport.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsContinuousExport.md @@ -1,5 +1,5 @@ ---- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +--- +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscontinuousexport schema: 2.0.0 @@ -8,169 +8,173 @@ schema: 2.0.0 # Get-AzApplicationInsightsContinuousExport ## SYNOPSIS -Get application insights continuous export configuration for an application insights resource +Get the Continuous Export configuration for this export id. ## SYNTAX -### ComponentNameParameterSet (Default) +### List (Default) ``` -Get-AzApplicationInsightsContinuousExport [-ResourceGroupName] [-Name] [[-ExportId] ] - [-DefaultProfile ] [] +Get-AzApplicationInsightsContinuousExport -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] ``` -### ComponentObjectParameterSet +### Get ``` -Get-AzApplicationInsightsContinuousExport [-ApplicationInsightsComponent] - [[-ExportId] ] [-DefaultProfile ] [] +Get-AzApplicationInsightsContinuousExport -ExportId -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] ``` -### ResourceIdParameterSet +### GetViaIdentity ``` -Get-AzApplicationInsightsContinuousExport [-ResourceId] [[-ExportId] ] - [-DefaultProfile ] [] +Get-AzApplicationInsightsContinuousExport -InputObject + [-DefaultProfile ] [] ``` ## DESCRIPTION -Get application insights continuous export configuration for an application insights resource +Get the Continuous Export configuration for this export id. ## EXAMPLES -### Example 1 Get continuous export for an application insights resource +### Example 1: Get continuous export for an application insights resource ```powershell -Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -``` -```output -ExportId DocumentTypes ExportStatus DestinationStorageAccountId --------- ------------- ------------ --------------------------- -ZJrfffySPdtG3ESn3iRxVIEFuNY= Request, Performance Counter Preparing /subscriptions/{subid}... +PS C:\> Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" ``` -Get application insights continuous export configurations for resource named "test" in resource group "testgroup" +Get continuous export for an application insights resource -### Example 2 Get continuous export for an application insights resource +### Example 2: Get continuous export for an application insights resource ```powershell -Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "ZJrfffySPdtG3ESn3iRxVIEFuNY=" -``` -```output -ExportId : ZJrfffySPdtG3ESn3iRxVIEFuNY= -StorageName : targetaccount -ContainerName : continuousexport -DocumentTypes : Request, Performance Counter -DestinationStorageSubscriptionId : {subid} -DestinationStorageLocationId : eastus -DestinationStorageAccountId : /subscriptions/{subid}/resourceGroups/targetstorage/providers/Microsoft.Storage/storageAccounts/targetaccount -IsEnabled : True -ExportStatus : Preparing -LastSuccessTime : +PS C:\> Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "ZJrfffySPdtG3ESn3iRxVIEFuNY=" ``` -Get application insights continuous export configuration with export id "ZJrfffySPdtG3ESn3iRxVIEFuNY=" for resource named "test" in resource group "testgroup" +Get continuous export for an application insights resource ## PARAMETERS -### -ApplicationInsightsComponent -Application Insights Component Object. +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ComponentObjectParameterSet -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True -Position: 0 +Required: False +Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` -### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +### -ExportId +The Continuous Export configuration ID. +This is unique within a Application Insights component. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer -Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Type: System.String +Parameter Sets: Get +Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ExportId -Application Insights Continuous Export Id. +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: System.String -Parameter Sets: (All) +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: GetViaIdentity Aliases: -Required: False -Position: 2 +Required: True +Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` ### -Name -Application Insights Component Name. +The name of the Application Insights component resource. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: List, Get Aliases: ApplicationInsightsComponentName, ComponentName Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name. +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: List, Get Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Application Insights Component Resource Id. +### -SubscriptionId +The ID of the target subscription. ```yaml -Type: System.String -Parameter Sets: ResourceIdParameterSet +Type: System.String[] +Parameter Sets: List, Get Aliases: -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent - -### System.String +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSExportConfiguration +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration ## NOTES +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsLinkedStorageAccount.md index 1b583207c5cb..4a7ddd6cee8b 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsLinkedStorageAccount.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsLinkedStorageAccount.md @@ -1,5 +1,5 @@ --- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightslinkedstorageaccount schema: 2.0.0 @@ -8,64 +8,43 @@ schema: 2.0.0 # Get-AzApplicationInsightsLinkedStorageAccount ## SYNOPSIS -Get application insights linked storage account +Returns the current linked storage settings for an Application Insights component. ## SYNTAX -### ByResourceNameParameterSet (Default) +### Get (Default) ``` -Get-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName -ComponentName - [-DefaultProfile ] [] +Get-AzApplicationInsightsLinkedStorageAccount -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] ``` -### ByInputObjectParameterSet +### GetViaIdentity ``` -Get-AzApplicationInsightsLinkedStorageAccount -InputObject - [-DefaultProfile ] [] -``` - -### ByResourceIdParameterSet -``` -Get-AzApplicationInsightsLinkedStorageAccount -ResourceId [-DefaultProfile ] - [] +Get-AzApplicationInsightsLinkedStorageAccount -InputObject + [-DefaultProfile ] [] ``` ## DESCRIPTION -Get application insights linked storage account +Returns the current linked storage settings for an Application Insights component. ## EXAMPLES -### Example 1 +### Example 1: Get linked storage account associated with component "componentName" ```powershell -Get-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName "rgName" -ComponentName "componentName" +PS C:\> Get-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName "rgName" -ComponentName "componentName" ``` Get linked storage account associated with component "componentName" ## PARAMETERS -### -ComponentName -Component Name - -```yaml -Type: System.String -Parameter Sets: ByResourceNameParameterSet -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.Management.Automation.PSObject Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: AzureRMContext, AzureCredential Required: False Position: Named @@ -75,11 +54,12 @@ Accept wildcard characters: False ``` ### -InputObject -PSApplicationInsightsComponent +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ByInputObjectParameterSet +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: GetViaIdentity Aliases: Required: True @@ -89,13 +69,13 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -ResourceGroupName -Resource Group Name +### -Name +The name of the Application Insights component resource. ```yaml Type: System.String -Parameter Sets: ByResourceNameParameterSet -Aliases: +Parameter Sets: Get +Aliases: ApplicationInsightsComponentName, ComponentName Required: True Position: Named @@ -104,12 +84,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Component ResourceId +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ByResourceIdParameterSet +Parameter Sets: Get Aliases: Required: True @@ -119,19 +100,52 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### System.String - -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSComponentLinkedStorageAccounts +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts ## NOTES +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsWebTest.md index d2e77571aac2..552a2790775b 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsWebTest.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Get-AzApplicationInsightsWebTest.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightswebtest schema: 2.0.0 @@ -14,8 +14,7 @@ Get a specific Application Insights web test definition. ### List1 (Default) ``` -Get-AzApplicationInsightsWebTest [-SubscriptionId ] [-DefaultProfile ] - [] +Get-AzApplicationInsightsWebTest [-SubscriptionId ] [-DefaultProfile ] [] ``` ### Get @@ -24,10 +23,10 @@ Get-AzApplicationInsightsWebTest -Name -ResourceGroupName [-Su [-DefaultProfile ] [] ``` -### GetViaIdentity +### List2 ``` -Get-AzApplicationInsightsWebTest -InputObject [-DefaultProfile ] - [] +Get-AzApplicationInsightsWebTest -ResourceGroupName [-SubscriptionId ] + -AppInsightsName [-DefaultProfile ] [] ``` ### List @@ -36,10 +35,10 @@ Get-AzApplicationInsightsWebTest -ResourceGroupName [-SubscriptionId ] [] ``` -### List2 +### GetViaIdentity ``` -Get-AzApplicationInsightsWebTest -AppInsightsName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [] +Get-AzApplicationInsightsWebTest -InputObject [-DefaultProfile ] + [] ``` ## DESCRIPTION @@ -51,6 +50,7 @@ Get a specific Application Insights web test definition. ```powershell Get-AzApplicationInsightsWebTest ``` + ```output Name Location WebTestKind ResourceGroupName ---- -------- ----------- ----------------- @@ -65,8 +65,9 @@ This command lists all Application Insights web tests under a subscription. ### Example 2: List all Application Insights web tests under a resource group ```powershell - Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test +Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test ``` + ```output Name Location WebTestKind ResourceGroupName ---- -------- ----------- ----------------- @@ -83,6 +84,7 @@ This command lists all Application Insights web tests under a resource group. ```powershell Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -AppInsightsName appinsights-portal01 ``` + ```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- @@ -99,6 +101,7 @@ This command lists all Application Insights web tests under a specific Applicati ```powershell Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 ``` + ```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- @@ -118,6 +121,7 @@ New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standar -RuleSslCheck -RuleSslCertRemainingLifetimeCheck 7 -RuleExpectedHttpStatusCode 200 ` -Enabled -Frequency 300 -Timeout 120 -Kind "standard" -RetryEnabled -GeoLocation $location01, $location02 ` |Get-AzApplicationInsightsWebTest ``` + ```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- @@ -195,7 +199,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: Get, List, List2 +Parameter Sets: Get, List2, List Aliases: Required: True @@ -210,7 +214,7 @@ The ID of the target subscription. ```yaml Type: System.String[] -Parameter Sets: Get, List, List1, List2 +Parameter Sets: List1, Get, List2, List Aliases: Required: False @@ -241,11 +245,16 @@ To create the parameters described below, construct a hash table containing the INPUTOBJECT : Identity Parameter + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. - `[SubscriptionId ]`: The ID of the target subscription. - `[WebTestName ]`: The name of the Application Insights WebTest resource. ## RELATED LINKS - diff --git a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsights.md index 7a89cd4cca9f..3347ba8cdcb6 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsights.md +++ b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsights.md @@ -1,5 +1,5 @@ --- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +external help file: Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights schema: 2.0.0 @@ -8,61 +8,180 @@ schema: 2.0.0 # New-AzApplicationInsights ## SYNOPSIS -Create a new application insights resource +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. ## SYNTAX ``` -New-AzApplicationInsights [-ResourceGroupName] [-Name] [-Location] [-Kind ] - [-Tag ] [-DefaultProfile ] [[-RetentionInDays] ] - [[-PublicNetworkAccessForIngestion] ] [[-PublicNetworkAccessForQuery] ] [-WhatIf] [-Confirm] - [] +New-AzApplicationInsights -Name -ResourceGroupName -Location + [-SubscriptionId ] [-ApplicationType ] [-DisableIPMasking] [-DisableLocalAuth] + [-Etag ] [-FlowType ] [-ForceCustomerStorageForProfiler] [-HockeyAppId ] + [-ImmediatePurgeDataOn30Day] [-IngestionMode ] [-Kind ] + [-PublicNetworkAccessForIngestion ] + [-PublicNetworkAccessForQuery ] [-RequestSource ] + [-RetentionInDays ] [-SamplingPercentage ] [-Tag ] [-WorkspaceResourceId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` ## DESCRIPTION -Create a new application insights resource +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. ## EXAMPLES -### Example 1 Create a new application insights resource +### Example 1: Create a new application insights resource ```powershell -New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus -``` -```output -Id : /subscriptions/{subid}/resourceGroups/testgroup/providers/microsoft.insights/components/test1027 -ResourceGroupName : testgroup -Name : test1027 -Kind : web -Location : eastus -Type : microsoft.insights/components -AppId : 8323fb13-32aa-46af-b467-8355cf4f8f98 -ApplicationType : web -Tags : {} -CreationDate : 10/27/2017 4:56:40 PM -FlowType : -HockeyAppId : -HockeyAppToken : -InstrumentationKey : 083112ed-ed9b-464e-a9b0-8cf126fbfced -ProvisioningState : Succeeded -RequestSource : AzurePowerShell -SamplingPercentage : -TenantId : {subid} -PublicNetworkAccessForIngestion : Enabled -PublicNetworkAccessForQuery : Enabled -PrivateLinkScopedResources : +PS C:\> New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus ``` Add a new application insights resource named as "test" in resource group "testgroup" with kind "java" ## PARAMETERS +### -ApplicationType +Type of application being monitored. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableIPMasking +Disable IP masking. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableLocalAuth +Disable Non-AAD based Auth. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +Resource etag + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FlowType +Used by the Application Insights system to determine what kind of flow this component was created by. +This is to be set to 'Bluefield' when creating/updating a component via the REST API. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ForceCustomerStorageForProfiler +Force users to create their own storage account for profiler and debugger. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HockeyAppId +The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmediatePurgeDataOn30Day +Purge data immediately after 30 days. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IngestionMode +Indicates the flow of the ingestion. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode +Parameter Sets: (All) +Aliases: Required: False Position: Named @@ -72,23 +191,23 @@ Accept wildcard characters: False ``` ### -Kind -Application kind. +The kind of application that this component refers to, used to customize UI. +This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. ```yaml Type: System.String Parameter Sets: (All) Aliases: ApplicationKind -Accepted values: web, other, Node.js, java Required: False Position: Named -Default value: web +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Location -Application Insights Resource Location. +Resource location ```yaml Type: System.String @@ -96,14 +215,14 @@ Parameter Sets: (All) Aliases: Required: True -Position: 2 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Name -Application Insights Resource Name. +The name of the Application Insights component resource. ```yaml Type: System.String @@ -111,44 +230,61 @@ Parameter Sets: (All) Aliases: ApplicationInsightsComponentName, ComponentName Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -PublicNetworkAccessForIngestion -The network access type for accessing Application Insights ingestion. Value should be 'Enabled' or 'Disabled' +The network access type for accessing Application Insights ingestion. ```yaml -Type: System.String +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -PublicNetworkAccessForQuery -The network access type for accessing Application Insights query. Value should be 'Enabled' or 'Disabled' +The network access type for accessing Application Insights query. ```yaml -Type: System.String +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestSource +Describes what tool created this Application Insights component. +Customers using this API should set this to the default 'rest'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name. +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String @@ -156,29 +292,59 @@ Parameter Sets: (All) Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -RetentionInDays -Retention In Days, 90 by default. +Retention period in days. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SamplingPercentage +Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. ```yaml -Type: System.Nullable`1[System.Int32] +Type: System.Double Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Tag -Component Tags. +Resource tags ```yaml Type: System.Collections.Hashtable @@ -192,6 +358,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -WorkspaceResourceId +Resource Id of the log analytics workspace which the data will be ingested to. +This property is required to create an application with this API version. +Applications from older versions will not have this property. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. @@ -208,7 +391,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -227,12 +411,13 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None - ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent ## NOTES +ALIASES + ## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsApiKey.md b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsApiKey.md index 0446b7444fa2..4a643b540347 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsApiKey.md +++ b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsApiKey.md @@ -1,5 +1,5 @@ ---- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +--- +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsapikey schema: 2.0.0 @@ -8,74 +8,39 @@ schema: 2.0.0 # New-AzApplicationInsightsApiKey ## SYNOPSIS -Create an application insights api key for an application insights resource +Create an API Key of an Application Insights component. ## SYNTAX -### ComponentNameParameterSet (Default) -``` -New-AzApplicationInsightsApiKey [-ResourceGroupName] [-Name] [-Permissions] - [-Description] [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ComponentObjectParameterSet ``` -New-AzApplicationInsightsApiKey [-ApplicationInsightsComponent] - [-Permissions] [-Description] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] -``` - -### ResourceIdParameterSet -``` -New-AzApplicationInsightsApiKey [-ResourceId] [-Permissions] [-Description] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] +New-AzApplicationInsightsApiKey -ResourceGroupName -Name [-SubscriptionId ] + -Description -Permissions [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION -Create an application insights api keys for an application insights resource +Create an API Key of an Application Insights component. ## EXAMPLES -### Example 1 Create a new Api Key for an application insights resource +### Example 1: Create a new Api Key for an application insights resource ```powershell -$apiKeyDescription = "testapiKey" -$permissions = @("ReadTelemetry", "WriteAnnotations") -New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Description $apiKeyDescription -Permissions $permissions -``` -```output -ApiKey : st0rfelw7m3oimfspozrtwgccxihiftbdwqjdfkg -CreatedDate : Fri, 27 Oct 2017 16:59:19 GMT -Id : 1ed593f9-1561-4981-922d-6917971eecd3 -Permissions : {ReadTelemetry, WriteAnnotations} -Description : testapiKey +PS C:\> $apiKeyDescription = "testapiKey" +PS C:\> $permissions = @("ReadTelemetry", "WriteAnnotations") +PS C:\> New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Description $apiKeyDescription -Permissions $permissions ``` -Create application insights api key description as "testapiKey" with permissions "ReadTelemetry", "WriteAnnotations" for resource "test" in resource group "testGroup". +Create a new Api Key for an application insights resource ## PARAMETERS -### -ApplicationInsightsComponent -Application Insights Component Object. - -```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ComponentObjectParameterSet -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.Management.Automation.PSObject Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: AzureRMContext, AzureCredential Required: False Position: Named @@ -85,7 +50,7 @@ Accept wildcard characters: False ``` ### -Description -Description to help identify this API key. +The name of the API Key. ```yaml Type: System.String @@ -93,70 +58,70 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Name -Component Name. +The name of the Application Insights component resource. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: (All) Aliases: ApplicationInsightsComponentName, ComponentName Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Permissions -Permissions that API key allow apps to do. +The read access rights of this API Key. ```yaml Type: System.String[] Parameter Sets: (All) Aliases: -Accepted values: ReadTelemetry, WriteAnnotations, AuthenticateSDKControlChannel Required: True -Position: 2 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name. +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: (All) Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Application Insights Component Resource Id. +### -SubscriptionId +The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: ResourceIdParameterSet +Parameter Sets: (All) Aliases: -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False Accept wildcard characters: False ``` @@ -176,7 +141,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -191,18 +157,16 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent - -### System.String - ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApiKey +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey ## NOTES +ALIASES + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsContinuousExport.md index b4d6a511f991..db96942cbdda 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsContinuousExport.md +++ b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsContinuousExport.md @@ -1,5 +1,5 @@ ---- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +--- +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport schema: 2.0.0 @@ -8,83 +8,59 @@ schema: 2.0.0 # New-AzApplicationInsightsContinuousExport ## SYNOPSIS -Create a new application insights continuous export configuration for an application insights resource +Create a Continuous Export configuration of an Application Insights component. ## SYNTAX -### ComponentNameParameterSet (Default) ``` -New-AzApplicationInsightsContinuousExport [-ResourceGroupName] [-Name] - -DocumentType -StorageAccountId -StorageLocation -StorageSASUri - [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ComponentObjectParameterSet -``` -New-AzApplicationInsightsContinuousExport [-ApplicationInsightsComponent] - -DocumentType -StorageAccountId -StorageLocation -StorageSASUri - [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ResourceIdParameterSet -``` -New-AzApplicationInsightsContinuousExport [-ResourceId] -DocumentType - -StorageAccountId -StorageLocation -StorageSASUri - [-DefaultProfile ] [-WhatIf] [-Confirm] [] +New-AzApplicationInsightsContinuousExport -ResourceGroupName -Name [-SubscriptionId ] + [-DestinationType ] [-NotificationQueueEnabled ] [-NotificationQueueUri ] + [-DocumentType ] [-StorageAccountId ] [-StorageLocation ] [-StorageSASUri ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -Create a new application insights continuous export configuration for an application insights resource +Create a Continuous Export configuration of an Application Insights component. ## EXAMPLES -### Example 1 Create a new continuous export configuration for an application insights resource +### Example 1: Create a new continuous export configuration for an application insights resource ```powershell -$sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w -$sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken -New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" ` +PS C:\> $sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +PS C:\> $sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +PS C:\> New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" ` -DocumentType "Request","Trace", "Custom Event" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus ` -StorageSASUri $sasuri ``` -```output -ExportId : jlTFEiBg1rkDXOCIeJQ2mB2TxZg= -StorageName : teststorageaccount -ContainerName : testcontainer -DocumentTypes : Request, Custom Event, Trace -DestinationStorageSubscriptionId : 50359d91-7b9d-4823-85af-eb298a61ba96 -DestinationStorageLocationId : sourcecentralus -DestinationStorageAccountId : /subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount -IsEnabled : True -ExportStatus : Preparing -LastSuccessTime : -``` -Create a new application insights continuous export configuration to export "Request" and "Trace" document types to storage contain "testcontainer" in storage account "teststorageaccount" in resource group "testgroup". The SAS token have to be valid and have write permission to the container, otherwise continuous export feature won't work.If SAS token expired, the continuous export feature will stop working. +Create a new application insights continuous export configuration to export "Request" and "Trace" document types to storage contain "testcontainer" in storage account "teststorageaccount" in resource group "testgroup". +The SAS token have to be valid and have write permission to the container, otherwise continuous export feature won't work.If SAS token expired, the continuous export feature will stop working. ## PARAMETERS -### -ApplicationInsightsComponent -Application Insights Component Object. +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ComponentObjectParameterSet -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True -Position: 0 +Required: False +Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` -### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +### -DestinationType +The Continuous Export destination type. +This has to be 'Blob'. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.String Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: Required: False Position: Named @@ -93,16 +69,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -DocumentType -Document types that need exported. +### -DocumentType +{{ Fill DocumentType Description }} ```yaml Type: System.String[] Parameter Sets: (All) Aliases: -Accepted values: Request, Exception, Custom Event, Trace, Metric, Page Load, Page View, Dependency, Availability, Performance Counter -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -110,59 +85,75 @@ Accept wildcard characters: False ``` ### -Name -Component Name. +The name of the Application Insights component resource. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: (All) Aliases: ApplicationInsightsComponentName, ComponentName Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceGroupName -Resource Group Name. +### -NotificationQueueEnabled +Deprecated ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: (All) Aliases: -Required: True -Position: 0 +Required: False +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Application Insights Component Resource Id. +### -NotificationQueueUri +Deprecated ```yaml Type: System.String -Parameter Sets: ResourceIdParameterSet +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) Aliases: Required: True -Position: 0 +Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` ### -StorageAccountId -Destination Storage Account Id. +The name of destination storage account. ```yaml Type: System.String Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -170,14 +161,14 @@ Accept wildcard characters: False ``` ### -StorageLocation -Destination Storage Location Id. +The location ID of the destination storage container. ```yaml Type: System.String Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -185,20 +176,36 @@ Accept wildcard characters: False ``` ### -StorageSASUri -Destination Storage SAS Uri. +The SAS URL for the destination storage container. +It must grant write permission. ```yaml Type: System.String Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. @@ -215,7 +222,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -230,18 +238,16 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent - -### System.String - ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSExportConfiguration +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration ## NOTES +ALIASES + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsLinkedStorageAccount.md index 95123c583f6a..547647d42274 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsLinkedStorageAccount.md +++ b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsLinkedStorageAccount.md @@ -1,5 +1,5 @@ --- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightslinkedstorageaccount schema: 2.0.0 @@ -8,67 +8,38 @@ schema: 2.0.0 # New-AzApplicationInsightsLinkedStorageAccount ## SYNOPSIS -Create an application insights linked storage account +Replace current linked storage account for an Application Insights component. ## SYNTAX -### ByResourceNameParameterSet (Default) ``` -New-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName -ComponentName - -LinkedStorageAccountResourceId [-DefaultProfile ] [-WhatIf] [-Confirm] - [] -``` - -### ByInputObjectParameterSet -``` -New-AzApplicationInsightsLinkedStorageAccount -InputObject - -LinkedStorageAccountResourceId [-DefaultProfile ] [-WhatIf] [-Confirm] - [] -``` - -### ByResourceIdParameterSet -``` -New-AzApplicationInsightsLinkedStorageAccount -ResourceId -LinkedStorageAccountResourceId - [-DefaultProfile ] [-WhatIf] [-Confirm] [] +New-AzApplicationInsightsLinkedStorageAccount -Name -ResourceGroupName + [-SubscriptionId ] [-LinkedStorageAccountResourceId ] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION -Create an application insights linked storage account +Replace current linked storage account for an Application Insights component. ## EXAMPLES -### Example 1 +### Example 1: Create an application insights linked storage account ```powershell -$account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" -Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | New-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id +PS C:\> $account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" +PS C:\> Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | New-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id ``` Create linked storage account $account under component "componentName" ## PARAMETERS -### -ComponentName -Component Name - -```yaml -Type: System.String -Parameter Sets: ByResourceNameParameterSet -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.Management.Automation.PSObject Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: AzureRMContext, AzureCredential Required: False Position: Named @@ -77,28 +48,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InputObject -PSApplicationInsightsComponent +### -LinkedStorageAccountResourceId +Linked storage account resource ID ```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ByInputObjectParameterSet +Type: System.String +Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` -### -LinkedStorageAccountResourceId -Storage Account ResourceId +### -Name +The name of the Application Insights component resource. ```yaml Type: System.String Parameter Sets: (All) -Aliases: +Aliases: ApplicationInsightsComponentName, ComponentName Required: True Position: Named @@ -108,11 +79,12 @@ Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ByResourceNameParameterSet +Parameter Sets: (All) Aliases: Required: True @@ -122,17 +94,17 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Component ResourceId +### -SubscriptionId +The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: ByResourceIdParameterSet +Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named -Default value: None +Default value: (Get-AzContext).Subscription.Id Accept pipeline input: False Accept wildcard characters: False ``` @@ -173,14 +145,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### System.String - -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent - ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSComponentLinkedStorageAccounts +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts ## NOTES +ALIASES + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTest.md index e5b0cbbb76dd..7bcfc543abeb 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTest.md +++ b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTest.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightswebtest schema: 2.0.0 @@ -14,24 +14,24 @@ Creates or updates an Application Insights web test definition. ### CreateStandard (Default) ``` -New-AzApplicationInsightsWebTest -Name -ResourceGroupName -Location - [-SubscriptionId ] [-ContentIgnoreCase] [-ContentMatch ] [-ContentPassIfTextFound] +New-AzApplicationInsightsWebTest -Name -ResourceGroupName [-SubscriptionId ] + -Location [-ContentIgnoreCase] [-ContentMatch ] [-ContentPassIfTextFound] [-Description ] [-Enabled] [-Frequency ] [-GeoLocation ] [-Kind ] [-RequestBody ] [-RequestFollowRedirect] [-RequestHeader ] [-RequestHttpVerb ] [-RequestParseDependent] [-RequestUrl ] [-RetryEnabled] [-RuleExpectedHttpStatusCode ] [-RuleIgnoreHttpsStatusCode] [-RuleSslCertRemainingLifetimeCheck ] [-RuleSslCheck] [-Tag ] [-TestName ] - [-Timeout ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] + [-Timeout ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### CreateClassic ``` -New-AzApplicationInsightsWebTest -Name -ResourceGroupName -Location - [-SubscriptionId ] [-Configuration ] [-ContentMatch ] [-Description ] - [-Enabled] [-Frequency ] [-GeoLocation ] [-Kind ] - [-RequestParseDependent] [-RequestUrl ] [-RetryEnabled] [-RuleExpectedHttpStatusCode ] - [-Tag ] [-TestName ] [-Timeout ] [-DefaultProfile ] [-Confirm] [-WhatIf] - [] +New-AzApplicationInsightsWebTest -Name -ResourceGroupName [-SubscriptionId ] + -Location [-ContentMatch ] [-Description ] [-Enabled] [-Frequency ] + [-GeoLocation ] [-Kind ] [-RequestParseDependent] + [-RequestUrl ] [-RetryEnabled] [-RuleExpectedHttpStatusCode ] [-Tag ] + [-TestName ] [-Timeout ] [-Configuration ] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -49,6 +49,7 @@ New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standar -RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'standard-pwsh01' ` -RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation ``` + ```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- @@ -70,6 +71,7 @@ New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwe -Kind 'ping' -RequestUrl 'https://cn.bing.com' -RequestParseDependent -RuleExpectedHttpStatusCode 200 ` -ContentMatch "status" ``` + ```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- @@ -103,6 +105,7 @@ New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwe " ``` + ```output Name Location WebTestKind ResourceGroupName Enabled ---- -------- ----------- ----------------- ------- @@ -598,4 +601,3 @@ REQUESTHEADER : List of headers and their values to add to the W - `[Value ]`: The value of the header. ## RELATED LINKS - diff --git a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTestGeolocationObject.md b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTestGeolocationObject.md index 788737930568..b017361c8341 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTestGeolocationObject.md +++ b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTestGeolocationObject.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.ApplicationInsights/new-AzApplicationInsightsWebTestGeolocationObject schema: 2.0.0 @@ -25,6 +25,7 @@ Create an in-memory object for WebTestGeolocation. ```powershell New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" ``` + ```output Location -------- @@ -65,4 +66,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTestHeaderFieldObject.md b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTestHeaderFieldObject.md index 9ad7ad0cea6d..127b0aefe64c 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTestHeaderFieldObject.md +++ b/src/ApplicationInsights/ApplicationInsights/help/New-AzApplicationInsightsWebTestHeaderFieldObject.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.ApplicationInsights/new-AzApplicationInsightsWebTestHeaderFieldObject schema: 2.0.0 @@ -25,6 +25,7 @@ Create a in-memory object for HeaderField ```powershell New-AzApplicationInsightsWebTestHeaderFieldObject -Name 'version' -Value '2.0.1' ``` + ```output Name Value ---- ----- @@ -79,4 +80,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsights.md index b705aa124152..6d4920cc42b3 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsights.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsights.md @@ -1,5 +1,5 @@ --- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsights schema: 2.0.0 @@ -8,92 +8,84 @@ schema: 2.0.0 # Remove-AzApplicationInsights ## SYNOPSIS -Remove an application insights resource +Deletes an Application Insights component. ## SYNTAX -### ComponentNameParameterSet (Default) +### Delete (Default) ``` -Remove-AzApplicationInsights [-ResourceGroupName] [-Name] [-PassThru] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] +Remove-AzApplicationInsights -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-WhatIf] [-Confirm] [] ``` -### ComponentObjectParameterSet +### DeleteViaIdentity ``` -Remove-AzApplicationInsights [-ApplicationInsightsComponent] [-PassThru] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ResourceIdParameterSet -``` -Remove-AzApplicationInsights [-ResourceId] [-PassThru] [-DefaultProfile ] - [-WhatIf] [-Confirm] [] +Remove-AzApplicationInsights -InputObject [-DefaultProfile ] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -Remove an application insights resource +Deletes an Application Insights component. ## EXAMPLES -### Example 1 Remove an application insights resource +### Example 1: Remove an application insights resource ```powershell -Remove-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -PassThru -``` -```output -True +PS C:\> Remove-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -PassThru ``` Remove an application insights resource named "test" in resource group "testgroup" ## PARAMETERS -### -ApplicationInsightsComponent -Application Insights Component Object. +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ComponentObjectParameterSet -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True -Position: 0 +Required: False +Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` -### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer -Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: DeleteViaIdentity +Aliases: -Required: False +Required: True Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` ### -Name -Application Insights Component Name. +The name of the Application Insights component resource. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: Delete Aliases: ApplicationInsightsComponentName, ComponentName Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -PassThru -If specified will write true in case operation succeeds. This parameter is optional. Default value is false. +Returns true when the command succeeds ```yaml Type: System.Management.Automation.SwitchParameter @@ -108,32 +100,33 @@ Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name. +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: Delete Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Application Insights Component Resource Id. +### -SubscriptionId +The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: ResourceIdParameterSet +Parameter Sets: Delete Aliases: -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False Accept wildcard characters: False ``` @@ -173,9 +166,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent - -### System.String +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity ## OUTPUTS @@ -183,4 +174,24 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsApiKey.md b/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsApiKey.md index 2af80601e011..14df15af7bcd 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsApiKey.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsApiKey.md @@ -1,5 +1,5 @@ ---- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +--- +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightsapikey schema: 2.0.0 @@ -8,84 +8,59 @@ schema: 2.0.0 # Remove-AzApplicationInsightsApiKey ## SYNOPSIS -Remove an application insights api key for an application insights resource +Delete an API Key of an Application Insights component. ## SYNTAX -### ComponentNameParameterSet (Default) -``` -Remove-AzApplicationInsightsApiKey [-ResourceGroupName] [-Name] [-ApiKeyId] - [-PassThru] [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ComponentObjectParameterSet +### Delete (Default) ``` -Remove-AzApplicationInsightsApiKey [-ApplicationInsightsComponent] - [-ApiKeyId] [-PassThru] [-DefaultProfile ] [-WhatIf] [-Confirm] - [] +Remove-AzApplicationInsightsApiKey -ApiKeyId -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` -### ResourceIdParameterSet +### DeleteViaIdentity ``` -Remove-AzApplicationInsightsApiKey [-ResourceId] [-ApiKeyId] [-PassThru] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] +Remove-AzApplicationInsightsApiKey -InputObject [-DefaultProfile ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -Remove an application insights api key for an application insights resource +Delete an API Key of an Application Insights component. ## EXAMPLES -### Example 1 Remove an application insights api key for an application insights resource +### Example 1: Remove an application insights api key for an application insights resource ```powershell -Remove-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId dd173f38-4fd1-4c75-8af5-99c29aa0f867 -PassThru -``` -```output -True +PS C:\> Remove-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -ApiKeyId dd173f38-4fd1-4c75-8af5-99c29aa0f867 -PassThru ``` -Remove specific application insights api key that id is "dd173f38-4fd1-4c75-8af5-9 -9c29aa0f867" for resource "test" in resource group "testGroup". +Remove an application insights api key for an application insights resource ## PARAMETERS ### -ApiKeyId -Application Insights API Key ID. +The API Key ID. +This is unique within a Application Insights component. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: Delete Aliases: Required: True -Position: 2 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ApplicationInsightsComponent -Application Insights Component Object. - -```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ComponentObjectParameterSet -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.Management.Automation.PSObject Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: AzureRMContext, AzureCredential Required: False Position: Named @@ -94,30 +69,31 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Name -Application Insights Component Name. +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: System.String -Parameter Sets: ComponentNameParameterSet -Aliases: ApplicationInsightsComponentName, ComponentName +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: DeleteViaIdentity +Aliases: Required: True -Position: 1 +Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -PassThru -If specified will write true in case operation succeeds. This parameter is optional. Default value is false. +### -Name +The name of the Application Insights component resource. ```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: +Type: System.String +Parameter Sets: Delete +Aliases: ApplicationInsightsComponentName, ComponentName -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False @@ -125,32 +101,33 @@ Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name. +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: Delete Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Application Insights Component Resource Id. +### -SubscriptionId +The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: ResourceIdParameterSet +Parameter Sets: Delete Aliases: -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False Accept wildcard characters: False ``` @@ -186,18 +163,36 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent - -### System.String +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity ## OUTPUTS -### System.Boolean +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey ## NOTES +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsContinuousExport.md index 02d4e7370e22..255e4d490f7a 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsContinuousExport.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsContinuousExport.md @@ -1,5 +1,5 @@ ---- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +--- +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightscontinuousexport schema: 2.0.0 @@ -8,69 +8,43 @@ schema: 2.0.0 # Remove-AzApplicationInsightsContinuousExport ## SYNOPSIS -Remove a continuous export configuration in an application insights resource +Delete a Continuous Export configuration of an Application Insights component. ## SYNTAX -### ComponentNameParameterSet (Default) -``` -Remove-AzApplicationInsightsContinuousExport [-ResourceGroupName] [-Name] - [-ExportId] [-PassThru] [-DefaultProfile ] [-WhatIf] [-Confirm] - [] -``` - -### ComponentObjectParameterSet +### Delete (Default) ``` -Remove-AzApplicationInsightsContinuousExport [-ApplicationInsightsComponent] - [-ExportId] [-PassThru] [-DefaultProfile ] [-WhatIf] [-Confirm] - [] +Remove-AzApplicationInsightsContinuousExport -ExportId -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` -### ResourceIdParameterSet +### DeleteViaIdentity ``` -Remove-AzApplicationInsightsContinuousExport [-ResourceId] [-ExportId] [-PassThru] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] +Remove-AzApplicationInsightsContinuousExport -InputObject + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -Remove a continuous export configuration in an application insights resource +Delete a Continuous Export configuration of an Application Insights component. ## EXAMPLES -### Example 1 Remove a continuous export configuration in an application insights resource +### Example 1: Remove a continuous export configuration in an application insights resource ```powershell -Remove-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "uGOoki0jQsyEs3IdQ83Q4QsNr4=" -PassThru -``` -```output -True +PS C:\> Remove-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -ExportId "uGOoki0jQsyEs3IdQ83Q4QsNr4=" -PassThru ``` -Remove application insights continuous export configuration with export id "uGOoki0jQsyEs3IdQ83Q4QsNr4=" for resource named "test" in resource group "testgroup" +Remove a continuous export configuration in an application insights resource ## PARAMETERS -### -ApplicationInsightsComponent -Application Insights Component Object. - -```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ComponentObjectParameterSet -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.Management.Automation.PSObject Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: AzureRMContext, AzureCredential Required: False Position: Named @@ -80,44 +54,46 @@ Accept wildcard characters: False ``` ### -ExportId -Application Insights Continuous Export ID. +The Continuous Export configuration ID. +This is unique within a Application Insights component. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: Delete Aliases: Required: True -Position: 2 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -Name -Application Insights Component Name. +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: System.String -Parameter Sets: ComponentNameParameterSet -Aliases: ApplicationInsightsComponentName, ComponentName +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: DeleteViaIdentity +Aliases: Required: True -Position: 1 +Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -PassThru -If specified will write true in case operation succeeds. This parameter is optional. Default value is false. +### -Name +The name of the Application Insights component resource. ```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: +Type: System.String +Parameter Sets: Delete +Aliases: ApplicationInsightsComponentName, ComponentName -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False @@ -125,32 +101,33 @@ Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name. +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: Delete Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Application Insights Component Resource Id. +### -SubscriptionId +The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: ResourceIdParameterSet +Parameter Sets: Delete Aliases: -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False Accept wildcard characters: False ``` @@ -186,18 +163,36 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent - -### System.String +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity ## OUTPUTS -### System.Boolean +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration ## NOTES +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsLinkedStorageAccount.md index 050373f2007d..7b8d7968912f 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsLinkedStorageAccount.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsLinkedStorageAccount.md @@ -1,5 +1,5 @@ --- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightslinkedstorageaccount schema: 2.0.0 @@ -8,93 +8,104 @@ schema: 2.0.0 # Remove-AzApplicationInsightsLinkedStorageAccount ## SYNOPSIS -Delete application insights linked storage account +Delete linked storage accounts for an Application Insights component. ## SYNTAX -### ByResourceNameParameterSet (Default) +### Delete (Default) ``` -Remove-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName -ComponentName - [-DefaultProfile ] [-WhatIf] [-Confirm] [] +Remove-AzApplicationInsightsLinkedStorageAccount -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-WhatIf] [-Confirm] [] ``` -### ByInputObjectParameterSet +### DeleteViaIdentity ``` -Remove-AzApplicationInsightsLinkedStorageAccount -InputObject - [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ByResourceIdParameterSet -``` -Remove-AzApplicationInsightsLinkedStorageAccount -ResourceId - [-DefaultProfile ] [-WhatIf] [-Confirm] [] +Remove-AzApplicationInsightsLinkedStorageAccount -InputObject + [-DefaultProfile ] [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -Delete application insights linked storage account +Delete linked storage accounts for an Application Insights component. ## EXAMPLES -### Example 1 +### Example 1: Delete linked storage account associated with application insights component "componentName" ```powershell -Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Remove-AzApplicationInsightsLinkedStorageAccount +PS C:\> Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Remove-AzApplicationInsightsLinkedStorageAccount ``` Delete linked storage account associated with application insights component "componentName" ## PARAMETERS -### -ComponentName -Component Name +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: System.String -Parameter Sets: ByResourceNameParameterSet +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: DeleteViaIdentity Aliases: Required: True Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with Azure. +### -Name +The name of the Application Insights component resource. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer -Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Type: System.String +Parameter Sets: Delete +Aliases: ApplicationInsightsComponentName, ComponentName -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -InputObject -PSApplicationInsightsComponent +### -PassThru +Returns true when the command succeeds ```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ByInputObjectParameterSet +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ByResourceNameParameterSet +Parameter Sets: Delete Aliases: Required: True @@ -104,17 +115,17 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Component ResourceId +### -SubscriptionId +The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: ByResourceIdParameterSet +Parameter Sets: Delete Aliases: -Required: True +Required: False Position: Named -Default value: None +Default value: (Get-AzContext).Subscription.Id Accept pipeline input: False Accept wildcard characters: False ``` @@ -155,9 +166,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### System.String - -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity ## OUTPUTS @@ -165,4 +174,24 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsWebTest.md index 6842f325d13b..106a03297270 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsWebTest.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Remove-AzApplicationInsightsWebTest.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightswebtest schema: 2.0.0 @@ -15,13 +15,13 @@ Deletes an Application Insights web test. ### Delete (Default) ``` Remove-AzApplicationInsightsWebTest -Name -ResourceGroupName [-SubscriptionId ] - [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] + [-DefaultProfile ] [-PassThru] [-WhatIf] [-Confirm] [] ``` ### DeleteViaIdentity ``` Remove-AzApplicationInsightsWebTest -InputObject [-DefaultProfile ] - [-PassThru] [-Confirm] [-WhatIf] [] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -189,11 +189,16 @@ To create the parameters described below, construct a hash table containing the INPUTOBJECT : Identity Parameter + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. - `[SubscriptionId ]`: The ID of the target subscription. - `[WebTestName ]`: The name of the Application Insights WebTest resource. ## RELATED LINKS - diff --git a/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsContinuousExport.md b/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsContinuousExport.md index 2570b4b8cec9..ea35a15fd309 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsContinuousExport.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsContinuousExport.md @@ -1,91 +1,67 @@ ---- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +--- +external help file: Module Name: Az.ApplicationInsights -online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightscontinuousexport +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport schema: 2.0.0 --- # Set-AzApplicationInsightsContinuousExport ## SYNOPSIS -Update a continuous export configuration in an application insights resource +Create a Continuous Export configuration of an Application Insights component. ## SYNTAX -### ComponentNameParameterSet (Default) ``` -Set-AzApplicationInsightsContinuousExport [-ResourceGroupName] [-Name] -ExportId - -DocumentType -StorageAccountId -StorageLocation -StorageSASUri - [-DisableConfiguration] [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ComponentObjectParameterSet -``` -Set-AzApplicationInsightsContinuousExport [-ApplicationInsightsComponent] - -ExportId -DocumentType -StorageAccountId -StorageLocation - -StorageSASUri [-DisableConfiguration] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] -``` - -### ResourceIdParameterSet -``` -Set-AzApplicationInsightsContinuousExport [-ResourceId] -ExportId -DocumentType - -StorageAccountId -StorageLocation -StorageSASUri [-DisableConfiguration] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] +Set-AzApplicationInsightsContinuousExport -ExportId -Name -ResourceGroupName + [-SubscriptionId ] [-DestinationType ] [-DisableConfiguration] [-DocumentType ] + [-NotificationQueueEnabled ] [-NotificationQueueUri ] [-StorageAccountId ] + [-StorageLocation ] [-StorageSASUri ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] ``` ## DESCRIPTION -Update a continuous export configuration in an application insights resource +Create a Continuous Export configuration of an Application Insights component. ## EXAMPLES -### Example 1 +### Example 1: Update continuous export configuration ```powershell -$sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w -$sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken -Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" +PS C:\> $sastoken = New-AzStorageContainerSASToken -Name testcontainer -Context $context -ExpiryTime (Get-Date).AddYears(50) -Permission w +PS C:\> $sasuri = "https://teststorageaccount.blob.core.windows.net/testcontainer" + $sastoken +PS C:\> Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name "test" -DocumentType "Request","Trace" -ExportId "jlTFEiBg1rkDXOCIeJQ2mB2TxZg=" -StorageAccountId "/subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount" -StorageLocation sourcecentralus -StorageSASUri $sasuri ``` -```output -ExportId : jlTFEiBg1rkDXOCIeJQ2mB2TxZg= -StorageName : teststorageaccount -ContainerName : testcontainer -DocumentTypes : Request, Custom Event, Trace -DestinationStorageSubscriptionId : 50359d91-7b9d-4823-85af-eb298a61ba96 -DestinationStorageLocationId : sourcecentralus -DestinationStorageAccountId : /subscriptions/50359d91-7b9d-4823-85af-eb298a61ba96/resourceGroups/testgroup/providers/Microsoft.Storage/storageAccounts/teststorageaccount -IsEnabled : True -ExportStatus : Preparing -LastSuccessTime : -``` -Update continuous export configuration "jlTFEiBg1rkDXOCIeJQ2mB2TxZg=" of resource "test" in resource group "testgroup" to export "Request" and "Trace" documents to storage container "testcontainer" in "teststorageaccount".The SAS token have to be valid and have write permission to the container, otherwise continuous export feature won't work. If SAS token expired, the continuous export feature will stop working. +Update continuous export configuration "jlTFEiBg1rkDXOCIeJQ2mB2TxZg=" of resource "test" in resource group "testgroup" to export "Request" and "Trace" documents to storage container "testcontainer" in "teststorageaccount".The SAS token have to be valid and have write permission to the container, otherwise continuous export feature won't work. +If SAS token expired, the continuous export feature will stop working. ## PARAMETERS -### -ApplicationInsightsComponent -Application Insights Component Object. +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ComponentObjectParameterSet -Aliases: +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential -Required: True -Position: 0 +Required: False +Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` -### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +### -DestinationType +The Continuous Export destination type. +This has to be 'Blob'. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.String Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: Required: False Position: Named @@ -95,7 +71,7 @@ Accept wildcard characters: False ``` ### -DisableConfiguration -Disable continuous export or not. + ```yaml Type: System.Management.Automation.SwitchParameter @@ -109,16 +85,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -DocumentType -Document types that need exported. +### -DocumentType + ```yaml Type: System.String[] Parameter Sets: (All) Aliases: -Accepted values: Request, Exception, Custom Event, Trace, Metric, Page Load, Page View, Dependency, Availability, Performance Counter -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -126,7 +101,8 @@ Accept wildcard characters: False ``` ### -ExportId -Application Insights Continuous Export Id. +The Continuous Export configuration ID. +This is unique within a Application Insights component. ```yaml Type: System.String @@ -141,59 +117,75 @@ Accept wildcard characters: False ``` ### -Name -Application Insights Component Name. +The name of the Application Insights component resource. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: (All) Aliases: ApplicationInsightsComponentName, ComponentName Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceGroupName -Resource Group Name. +### -NotificationQueueEnabled +Deprecated ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: (All) Aliases: -Required: True -Position: 0 +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NotificationQueueUri +Deprecated + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Application Insights Component Resource Id. +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ResourceIdParameterSet +Parameter Sets: (All) Aliases: Required: True -Position: 0 +Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` ### -StorageAccountId -Destination Storage Account Id. +The name of destination storage account. ```yaml Type: System.String Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -201,14 +193,14 @@ Accept wildcard characters: False ``` ### -StorageLocation -Destination Storage Location Id. +The location ID of the destination storage container. ```yaml Type: System.String Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -216,20 +208,36 @@ Accept wildcard characters: False ``` ### -StorageSASUri -Destination Storage SAS uri. +The SAS URL for the destination storage container. +It must grant write permission. ```yaml Type: System.String Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. @@ -246,7 +254,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -261,18 +270,17 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent - -### System.String - ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSExportConfiguration +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration ## NOTES +ALIASES + ## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsDailyCap.md b/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsDailyCap.md index 39129a8f373e..53cd5d079044 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsDailyCap.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsDailyCap.md @@ -1,5 +1,5 @@ ---- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +--- +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightsdailycap schema: 2.0.0 @@ -8,70 +8,35 @@ schema: 2.0.0 # Set-AzApplicationInsightsDailyCap ## SYNOPSIS -Set daily data volume cap for an application insights resource +Update current billing features for an Application Insights component. ## SYNTAX -### ComponentNameParameterSet (Default) -``` -Set-AzApplicationInsightsDailyCap [-ResourceGroupName] [-Name] [-DailyCapGB ] - [-DisableNotificationWhenHitCap] [-DefaultProfile ] [-WhatIf] [-Confirm] - [] -``` - -### ComponentObjectParameterSet -``` -Set-AzApplicationInsightsDailyCap [-ApplicationInsightsComponent] - [-DailyCapGB ] [-DisableNotificationWhenHitCap] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] -``` - -### ResourceIdParameterSet ``` -Set-AzApplicationInsightsDailyCap [-ResourceId] [-DailyCapGB ] - [-DisableNotificationWhenHitCap] [-DefaultProfile ] [-WhatIf] [-Confirm] +Set-AzApplicationInsightsDailyCap -ResourceGroupName -Name [-SubscriptionId ] + [-DailyCapGB ] [-DisableNotificationWhenHitCap] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -Set daily data volume cap for an application insights resource +Update current billing features for an Application Insights component. ## EXAMPLES -### Example 1 Set daily data volume cap for an application insights resource +### Example 1: Set daily data volume cap for an application insights resource ```powershell -Set-AzApplicationInsightsDailyCap -ResourceGroupName "testgroup" -Name "test" -DailyCapGB 400 -DisableNotificationWhenHitCap -``` -```output - Cap ResetTime StopSendNotificationWhenHitCap ---- --------- ------------------------------ -400 0 True +PS C:\> Set-AzApplicationInsightsDailyCap -ResourceGroupName "testgroup" -Name "test" -DailyCapGB 400 -DisableNotificationWhenHitCap ``` Set the daily data volume cap to 400GB per day and stop send notification when hit cap for resource "test" in resource group "testgroup" ## PARAMETERS -### -ApplicationInsightsComponent -Application Insights Component Object. - -```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ComponentObjectParameterSet -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -DailyCapGB -Daily Cap. +Daily data volume cap in GB. ```yaml -Type: System.Nullable`1[System.Double] +Type: System.Double Parameter Sets: (All) Aliases: @@ -83,12 +48,12 @@ Accept wildcard characters: False ``` ### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.Management.Automation.PSObject Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: AzureRMContext, AzureCredential Required: False Position: Named @@ -113,47 +78,48 @@ Accept wildcard characters: False ``` ### -Name -Application Insights Component Name. +The name of the Application Insights component resource. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: (All) Aliases: ApplicationInsightsComponentName, ComponentName Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name. +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: (All) Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Application Insights Component Resource Id. +### -SubscriptionId +The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: ResourceIdParameterSet +Parameter Sets: (All) Aliases: -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False Accept wildcard characters: False ``` @@ -173,7 +139,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -188,18 +155,16 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent - -### System.String - ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSPricingPlan +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures ## NOTES +ALIASES + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsPricingPlan.md b/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsPricingPlan.md index d001251c00ed..7e57e4cd3475 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsPricingPlan.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsPricingPlan.md @@ -1,5 +1,5 @@ ---- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +--- +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightspricingplan schema: 2.0.0 @@ -8,72 +8,35 @@ schema: 2.0.0 # Set-AzApplicationInsightsPricingPlan ## SYNOPSIS -Set pricing plan and daily data volume information for an application insights resource +Update current billing features for an Application Insights component. ## SYNTAX -### ComponentNameParameterSet (Default) -``` -Set-AzApplicationInsightsPricingPlan [-ResourceGroupName] [-Name] [-PricingPlan ] - [-DailyCapGB ] [-DisableNotificationWhenHitCap] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] -``` - -### ComponentObjectParameterSet ``` -Set-AzApplicationInsightsPricingPlan [-ApplicationInsightsComponent] - [-PricingPlan ] [-DailyCapGB ] [-DisableNotificationWhenHitCap] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - -### ResourceIdParameterSet -``` -Set-AzApplicationInsightsPricingPlan [-ResourceId] [-PricingPlan ] [-DailyCapGB ] - [-DisableNotificationWhenHitCap] [-DefaultProfile ] [-WhatIf] [-Confirm] - [] +Set-AzApplicationInsightsPricingPlan -ResourceGroupName -Name [-SubscriptionId ] + [-PricingPlan ] [-DailyCapGB ] [-DisableNotificationWhenHitCap] [-DefaultProfile ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -Set pricing plan and daily data volume information for an application insights resource. -Pricing plan of application insights created after April 2018 cannot be set by this cmdlet: -https://docs.microsoft.com/azure/azure-monitor/app/pricing#legacy-enterprise-per-node-pricing-tier +Update current billing features for an Application Insights component. ## EXAMPLES -### Example 1 Set pricing plan and daily data volume information for an application insights resource +### Example 1: Set pricing plan and daily data volume information for an application insights resource ```powershell -Set-AzApplicationInsightsPricingPlan -ResourceGroupName "testgroup" -Name "test" -PricingPlan "Basic" -DailyCapGB 400 -``` -```output - Cap ResetTime StopSendNotificationWhenHitCap PricingPlan ---- --------- ------------------------------ ----------- -400 0 False Basic +PS C:\> Set-AzApplicationInsightsPricingPlan -ResourceGroupName "testgroup" -Name "test" -PricingPlan "Basic" -DailyCapGB 400 ``` Set the pricing plan to "Basic", set the daily data volume cap to 400GB per day and stop send notification when hit cap for resource "test" in resource group "testgroup" ## PARAMETERS -### -ApplicationInsightsComponent -Application Insights Component Object. - -```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ComponentObjectParameterSet -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -DailyCapGB -Daily Cap. +Daily data volume cap in GB. ```yaml -Type: System.Nullable`1[System.Double] +Type: System.Double Parameter Sets: (All) Aliases: @@ -85,12 +48,12 @@ Accept wildcard characters: False ``` ### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with azure. +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.Management.Automation.PSObject Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: AzureRMContext, AzureCredential Required: False Position: Named @@ -115,63 +78,64 @@ Accept wildcard characters: False ``` ### -Name -Application Insights Component Name. +The name of the Application Insights component resource. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: (All) Aliases: ApplicationInsightsComponentName, ComponentName Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -PricingPlan -Pricing plan name. +Current enabled pricing plan. +When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. ```yaml Type: System.String Parameter Sets: (All) Aliases: -Accepted values: Basic, Application Insights Enterprise, Limited Basic Required: False Position: Named -Default value: "Basic" +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name. +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ComponentNameParameterSet +Parameter Sets: (All) Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Application Insights Component Resource Id. +### -SubscriptionId +The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: ResourceIdParameterSet +Parameter Sets: (All) Aliases: -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False Accept wildcard characters: False ``` @@ -191,7 +155,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -206,18 +171,16 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent - -### System.String - ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSPricingPlan +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures ## NOTES +ALIASES + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsWebTest.md b/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsWebTest.md new file mode 100644 index 000000000000..797215e35c10 --- /dev/null +++ b/src/ApplicationInsights/ApplicationInsights/help/Set-AzApplicationInsightsWebTest.md @@ -0,0 +1,569 @@ +--- +external help file: Az.ApplicationInsights-help.xml +Module Name: Az.ApplicationInsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightswebtest +schema: 2.0.0 +--- + +# Set-AzApplicationInsightsWebTest + +## SYNOPSIS +Creates or updates an Application Insights web test definition. + +## SYNTAX + +``` +Set-AzApplicationInsightsWebTest -Name -ResourceGroupName [-SubscriptionId ] + -Location [-ConfigurationWebTest ] [-ContentValidationContentMatch ] + [-ContentValidationIgnoreCase] [-ContentValidationPassIfTextFound] [-Description ] [-Enabled] + [-Frequency ] [-Kind ] [-PropertiesLocations ] + [-PropertiesWebTestName ] [-RequestBody ] [-RequestFollowRedirect] + [-RequestHeader ] [-RequestHttpVerb ] [-RequestParseDependentRequest] + [-RequestUrl ] [-RetryEnabled] [-SyntheticMonitorId ] [-Tag ] [-Timeout ] + [-ValidationRuleExpectedHttpStatusCode ] [-ValidationRuleIgnoreHttpsStatusCode] + [-ValidationRuleSslCertRemainingLifetimeCheck ] [-ValidationRuleSslCheck] + [-WebTestKind ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Creates or updates an Application Insights web test definition. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +PS C:\> {{ Add code here }} + +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +PS C:\> {{ Add code here }} + +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ConfigurationWebTest +The XML specification of a WebTest to run against an application. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContentValidationContentMatch +Content to look for in the return of the WebTest. +Must not be null or empty. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContentValidationIgnoreCase +When set, this value makes the ContentMatch validation case insensitive. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContentValidationPassIfTextFound +When true, validation will pass if there is a match for the ContentMatch string. +If false, validation will fail if there is a match + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +User defined description for this WebTest. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Enabled +Is the test actively being monitored. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Frequency +Interval in seconds between test runs for this WebTest. +Default value is 300. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +The kind of WebTest that this web test watches. +Choices are ping and multistep. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Resource location + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights WebTest resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: WebTestName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesLocations +A list of where to physically run the tests from to give global coverage for accessibility of your application. +To construct, see NOTES section for PROPERTIESLOCATIONS properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTestGeolocation[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesWebTestName +User defined name if this WebTest. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestBody +Base64 encoded string body to send with this web test. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestFollowRedirect +Follow redirects for this web test. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestHeader +List of headers and their values to add to the WebTest call. +To construct, see NOTES section for REQUESTHEADER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IHeaderField[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestHttpVerb +Http verb to use for this web test. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestParseDependentRequest +Parse Dependent request for this WebTest. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestUrl +Url location to test. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RetryEnabled +Allow for retries should this WebTest fail. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SyntheticMonitorId +Unique ID of this WebTest. +This is typically the same value as the Name field. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Timeout +Seconds until this WebTest will timeout and fail. +Default value is 30. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ValidationRuleExpectedHttpStatusCode +Validate that the WebTest returns the http status code provided. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ValidationRuleIgnoreHttpsStatusCode +When set, validation will ignore the status code. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ValidationRuleSslCertRemainingLifetimeCheck +A number of days to check still remain before the the existing SSL cert expires. +Value must be positive and the SSLCheck must be set to true. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ValidationRuleSslCheck +Checks to see if the SSL cert is still valid. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WebTestKind +The kind of web test this is, valid choices are ping, multistep, and standard. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20180501Preview.IWebTest + +## NOTES + +ALIASES + +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. + + +PROPERTIESLOCATIONS : A list of where to physically run the tests from to give global coverage for accessibility of your application. + - `[Location ]`: Location ID for the WebTest to run from. + +REQUESTHEADER : List of headers and their values to add to the WebTest call. + - `[Name ]`: The name of the header. + - `[Value ]`: The value of the header. + +## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsights.md b/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsights.md index 255d55c07912..bc21dc81690d 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsights.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsights.md @@ -1,45 +1,187 @@ --- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +external help file: Module Name: Az.ApplicationInsights -online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsights +online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights schema: 2.0.0 --- # Update-AzApplicationInsights ## SYNOPSIS -update an existing application insights resource +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. ## SYNTAX ``` -Update-AzApplicationInsights [-ResourceGroupName] [-Name] [-Tag ] - [-DefaultProfile ] [[-RetentionInDays] ] - [[-PublicNetworkAccessForIngestion] ] [[-PublicNetworkAccessForQuery] ] [-WhatIf] [-Confirm] - [] +Update-AzApplicationInsights -Name -ResourceGroupName [-SubscriptionId ] + [-ApplicationType ] [-DisableIPMasking] [-DisableLocalAuth] [-Etag ] + [-FlowType ] [-ForceCustomerStorageForProfiler] [-HockeyAppId ] + [-ImmediatePurgeDataOn30Day] [-IngestionMode ] + [-PublicNetworkAccessForIngestion ] + [-PublicNetworkAccessForQuery ] [-RequestSource ] + [-RetentionInDays ] [-SamplingPercentage ] [-Tag ] [-WorkspaceResourceId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` ## DESCRIPTION -update an existing application insights resource +Creates (or updates) an Application Insights component. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. ## EXAMPLES -### Example 1 Update application insights component +### Example 1: Update application insights component ```powershell -Update-AzApplicationInsights -ResourceGroupName "rgName" -Name "aiName" -PublicNetworkAccessForIngestion "Disabled" -PublicNetworkAccessForQuery "Disabled" +PS C:\> Update-AzApplicationInsights -ResourceGroupName "rgName" -Name "aiName" -PublicNetworkAccessForIngestion "Disabled" -PublicNetworkAccessForQuery "Disabled" ``` update application insights component "aiName" PublicNetworkAccessForIngestion/PublicNetworkAccessForQuery both to "Disabled" ## PARAMETERS +### -ApplicationType +Type of application being monitored. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableIPMasking +Disable IP masking. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableLocalAuth +Disable Non-AAD based Auth. + +```yaml +Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +Resource etag + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FlowType +Used by the Application Insights system to determine what kind of flow this component was created by. +This is to be set to 'Bluefield' when creating/updating a component via the REST API. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ForceCustomerStorageForProfiler +Force users to create their own storage account for profiler and debugger. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HockeyAppId +The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmediatePurgeDataOn30Day +Purge data immediately after 30 days. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IngestionMode +Indicates the flow of the ingestion. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode +Parameter Sets: (All) +Aliases: Required: False Position: Named @@ -49,7 +191,7 @@ Accept wildcard characters: False ``` ### -Name -Application Insights Resource Name. +The name of the Application Insights component resource. ```yaml Type: System.String @@ -57,7 +199,7 @@ Parameter Sets: (All) Aliases: ApplicationInsightsComponentName, ComponentName Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -65,15 +207,14 @@ Accept wildcard characters: False ### -PublicNetworkAccessForIngestion The network access type for accessing Application Insights ingestion. -Value should be 'Enabled' or 'Disabled' ```yaml -Type: System.String +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -81,22 +222,38 @@ Accept wildcard characters: False ### -PublicNetworkAccessForQuery The network access type for accessing Application Insights query. -Value should be 'Enabled' or 'Disabled' ```yaml -Type: System.String +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestSource +Describes what tool created this Application Insights component. +Customers using this API should set this to the default 'rest'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name. +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String @@ -104,29 +261,59 @@ Parameter Sets: (All) Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -RetentionInDays -Retention In Days, 90 by default. +Retention period in days. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SamplingPercentage +Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. ```yaml -Type: System.Nullable`1[System.Int32] +Type: System.Double Parameter Sets: (All) Aliases: Required: False -Position: 2 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Tag -Component Tags. +Resource tags ```yaml Type: System.Collections.Hashtable @@ -140,6 +327,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -WorkspaceResourceId +Resource Id of the log analytics workspace which the data will be ingested to. +This property is required to create an application with this API version. +Applications from older versions will not have this property. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. @@ -176,12 +380,13 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### System.String - ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent ## NOTES +ALIASES + ## RELATED LINKS + diff --git a/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsightsLinkedStorageAccount.md b/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsightsLinkedStorageAccount.md index 57ac136f4f40..243125df205d 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsightsLinkedStorageAccount.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsightsLinkedStorageAccount.md @@ -1,5 +1,5 @@ --- -external help file: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll-Help.xml +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightslinkedstorageaccount schema: 2.0.0 @@ -8,68 +8,46 @@ schema: 2.0.0 # Update-AzApplicationInsightsLinkedStorageAccount ## SYNOPSIS -Update application insights linked storage account +Update linked storage accounts for an Application Insights component. ## SYNTAX -### ByResourceNameParameterSet (Default) +### UpdateExpanded (Default) ``` -Update-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName -ComponentName - -LinkedStorageAccountResourceId [-DefaultProfile ] [-WhatIf] [-Confirm] - [] +Update-AzApplicationInsightsLinkedStorageAccount -Name -ResourceGroupName + [-SubscriptionId ] [-LinkedStorageAccountResourceId ] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] ``` -### ByInputObjectParameterSet +### UpdateViaIdentityExpanded ``` -Update-AzApplicationInsightsLinkedStorageAccount -InputObject - -LinkedStorageAccountResourceId [-DefaultProfile ] [-WhatIf] [-Confirm] +Update-AzApplicationInsightsLinkedStorageAccount -InputObject + [-LinkedStorageAccountResourceId ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` -### ByResourceIdParameterSet -``` -Update-AzApplicationInsightsLinkedStorageAccount -ResourceId -LinkedStorageAccountResourceId - [-DefaultProfile ] [-WhatIf] [-Confirm] [] -``` - ## DESCRIPTION -Update application insights linked storage account +Update linked storage accounts for an Application Insights component. ## EXAMPLES -### Example 1 +### Example 1: Update linked storage account ```powershell -$account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" - -Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Update-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id +PS C:\> $account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" +PS C:\> Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Update-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id ``` Update linked storage account under component "componentName" to associate with $account ## PARAMETERS -### -ComponentName -Component Name - -```yaml -Type: System.String -Parameter Sets: ByResourceNameParameterSet -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: System.Management.Automation.PSObject Parameter Sets: (All) -Aliases: AzContext, AzureRmContext, AzureCredential +Aliases: AzureRMContext, AzureCredential Required: False Position: Named @@ -79,11 +57,12 @@ Accept wildcard characters: False ``` ### -InputObject -PSApplicationInsightsComponent +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent -Parameter Sets: ByInputObjectParameterSet +Type: Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +Parameter Sets: UpdateViaIdentityExpanded Aliases: Required: True @@ -94,13 +73,28 @@ Accept wildcard characters: False ``` ### -LinkedStorageAccountResourceId -Storage Account ResourceId +Linked storage account resource ID ```yaml Type: System.String Parameter Sets: (All) Aliases: +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the Application Insights component resource. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: ApplicationInsightsComponentName, ComponentName + Required: True Position: Named Default value: None @@ -109,11 +103,12 @@ Accept wildcard characters: False ``` ### -ResourceGroupName -Resource Group Name +The name of the resource group. +The name is case insensitive. ```yaml Type: System.String -Parameter Sets: ByResourceNameParameterSet +Parameter Sets: UpdateExpanded Aliases: Required: True @@ -123,17 +118,17 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -ResourceId -Component ResourceId +### -SubscriptionId +The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: ByResourceIdParameterSet +Parameter Sets: UpdateExpanded Aliases: -Required: True +Required: False Position: Named -Default value: None +Default value: (Get-AzContext).Subscription.Id Accept pipeline input: False Accept wildcard characters: False ``` @@ -174,14 +169,32 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### System.String - -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity ## OUTPUTS -### Microsoft.Azure.Commands.ApplicationInsights.Models.PSComponentLinkedStorageAccounts +### Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts ## NOTES +ALIASES + +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 + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. + - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. + - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[WebTestName ]`: The name of the Application Insights WebTest resource. + ## RELATED LINKS diff --git a/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsightsWebTestTag.md b/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsightsWebTestTag.md index b312feb3685f..b8d0b9d486e4 100644 --- a/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsightsWebTestTag.md +++ b/src/ApplicationInsights/ApplicationInsights/help/Update-AzApplicationInsightsWebTestTag.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.ApplicationInsights-help.xml Module Name: Az.ApplicationInsights online version: https://docs.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightswebtesttag schema: 2.0.0 @@ -15,13 +15,13 @@ Creates or updates an Application Insights web test definition. ### UpdateExpanded (Default) ``` Update-AzApplicationInsightsWebTestTag -Name -ResourceGroupName [-SubscriptionId ] - [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] + [-Tag ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### UpdateViaIdentityExpanded ``` Update-AzApplicationInsightsWebTestTag -InputObject [-Tag ] - [-DefaultProfile ] [-Confirm] [-WhatIf] [] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -33,6 +33,7 @@ Creates or updates an Application Insights web test definition. ```powershell Update-AzApplicationInsightsWebTestTag -ResourceGroupName azpwsh-rg-test -Name webtest01-lucasappinsights -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/lucasappinsights" = "Resource"} ``` + ```output Location Name WebTestKind ResourceGroupName Enabled -------- ---- ----------- ----------------- ------- @@ -45,6 +46,7 @@ This command updates Application Insights link of the Web test. ```powershell Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -WebTestName webtest01-lucasappinsights | Update-AzApplicationInsightsWebTestTag -Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsightsportal01" = "Resource"} ``` + ```output Location Name WebTestKind ResourceGroupName Enabled -------- ---- ----------- ----------------- ------- @@ -199,11 +201,16 @@ To create the parameters described below, construct a hash table containing the INPUTOBJECT : Identity Parameter + - `[AnnotationId ]`: The unique annotation ID. This is unique within a Application Insights component. - `[ComponentName ]`: The name of the Application Insights component resource. + - `[ExportId ]`: The Continuous Export configuration ID. This is unique within a Application Insights component. - `[Id ]`: Resource identity path + - `[KeyId ]`: The API Key ID. This is unique within a Application Insights component. + - `[PurgeId ]`: In a purge status request, this is the Id of the operation the status of which is returned. - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[ResourceName ]`: The name of the Application Insights component resource. + - `[StorageType ]`: The type of the Application Insights component data source for the linked storage account. - `[SubscriptionId ]`: The ID of the target subscription. - `[WebTestName ]`: The name of the Application Insights WebTest resource. ## RELATED LINKS - diff --git a/src/Monitor/Monitor.Test/ScenarioTests/AlertsTests.cs b/src/Monitor/Monitor.Test/ScenarioTests/AlertsTests.cs index 5ec4c84966fc..a1dc15b63025 100644 --- a/src/Monitor/Monitor.Test/ScenarioTests/AlertsTests.cs +++ b/src/Monitor/Monitor.Test/ScenarioTests/AlertsTests.cs @@ -149,7 +149,7 @@ public void TestAddAzureRmDynamicMetricAlertRuleV2() } [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] + [Trait(Category.AcceptanceType, Category.LiveOnly)] public void TestAddAzureRmWebtestAlertRuleV2() { TestsController.NewInstance.RunPsTest(_logger, "Test-AddAzureRmMetricAlertRuleV2-Webtest"); diff --git a/src/Monitor/Monitor.Test/ScenarioTests/PrivateLinkScopeTests.cs b/src/Monitor/Monitor.Test/ScenarioTests/PrivateLinkScopeTests.cs index 3d26bf68bd6d..3543fb67bda6 100644 --- a/src/Monitor/Monitor.Test/ScenarioTests/PrivateLinkScopeTests.cs +++ b/src/Monitor/Monitor.Test/ScenarioTests/PrivateLinkScopeTests.cs @@ -37,7 +37,7 @@ public void TestPrivateLinkScopeCRUD() } [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] + [Trait(Category.AcceptanceType, Category.LiveOnly)] public void TestPrivateLinkScopedResourceCRUD() { TestsController.NewInstance.RunPsTest(_logger, "Test-PrivateLinkScopedResourceCRUD"); diff --git a/src/Monitor/Monitor.Test/ScenarioTests/ScheduledQueryRulesTests.cs b/src/Monitor/Monitor.Test/ScenarioTests/ScheduledQueryRulesTests.cs index 76f9ed8c2fe9..7f3fdee87d00 100644 --- a/src/Monitor/Monitor.Test/ScenarioTests/ScheduledQueryRulesTests.cs +++ b/src/Monitor/Monitor.Test/ScenarioTests/ScheduledQueryRulesTests.cs @@ -30,14 +30,14 @@ public ScheduledQueryRulesTests(Xunit.Abstractions.ITestOutputHelper output) } [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] + [Trait(Category.AcceptanceType, Category.LiveOnly)] public void TestNewGetUpdateSetRemoveScheduledQueryRule() { TestsController.NewInstance.RunPsTest(_logger, "Test-NewGetUpdateSetRemoveScheduledQueryRule"); } [Fact] - [Trait(Category.AcceptanceType, Category.CheckIn)] + [Trait(Category.AcceptanceType, Category.LiveOnly)] public void TestPipingRemoveSetUpdateScheduledQueryRule() { TestsController.NewInstance.RunPsTest(_logger, "Test-PipingRemoveSetUpdateScheduledQueryRule"); diff --git a/tools/StaticAnalysis/Exceptions/Az.ApplicationInsights/BreakingChangeIssues.csv b/tools/StaticAnalysis/Exceptions/Az.ApplicationInsights/BreakingChangeIssues.csv new file mode 100644 index 000000000000..ab1e61f6ee8b --- /dev/null +++ b/tools/StaticAnalysis/Exceptions/Az.ApplicationInsights/BreakingChangeIssues.csv @@ -0,0 +1,159 @@ +"AssemblyFileName","ClassName","Target","Severity","ProblemId","Description","Remediation" +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsCommand","Get-AzApplicationInsights","0","1060","The parameter set 'ResourceGroupParameterSet' for cmdlet 'Get-AzApplicationInsights' is no longer the default parameter set.","Change the default parameter for cmdlet 'Get-AzApplicationInsights' back to 'ResourceGroupParameterSet'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsCommand","Get-AzApplicationInsights","0","2020","The cmdlet 'Get-AzApplicationInsights' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsCommand","Get-AzApplicationInsights","0","2010","The cmdlet 'Get-AzApplicationInsights' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsCommand","Get-AzApplicationInsights","0","2010","The cmdlet 'Get-AzApplicationInsights' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsCommand","Get-AzApplicationInsights","0","1050","The parameter set 'ResourceGroupParameterSet' for cmdlet 'Get-AzApplicationInsights' has been removed.","Add parameter set 'ResourceGroupParameterSet' back to cmdlet 'Get-AzApplicationInsights'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsCommand","Get-AzApplicationInsights","0","1050","The parameter set 'ComponentNameParameterSet' for cmdlet 'Get-AzApplicationInsights' has been removed.","Add parameter set 'ComponentNameParameterSet' back to cmdlet 'Get-AzApplicationInsights'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsCommand","Get-AzApplicationInsights","0","1050","The parameter set 'ResourceIdParameterSet' for cmdlet 'Get-AzApplicationInsights' has been removed.","Add parameter set 'ResourceIdParameterSet' back to cmdlet 'Get-AzApplicationInsights'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsApiKeyCommand","Get-AzApplicationInsightsApiKey","0","1020","The cmdlet 'Get-AzApplicationInsightsApiKey' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApiKey'.","Make cmdlet 'Get-AzApplicationInsightsApiKey' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsApiKeyCommand","Get-AzApplicationInsightsApiKey","0","1060","The parameter set 'ComponentNameParameterSet' for cmdlet 'Get-AzApplicationInsightsApiKey' is no longer the default parameter set.","Change the default parameter for cmdlet 'Get-AzApplicationInsightsApiKey' back to 'ComponentNameParameterSet'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsApiKeyCommand","Get-AzApplicationInsightsApiKey","0","2000","The cmdlet 'Get-AzApplicationInsightsApiKey' no longer supports the parameter 'ApplicationInsightsComponent' and no alias was found for the original parameter name.","Add the parameter 'ApplicationInsightsComponent' back to the cmdlet 'Get-AzApplicationInsightsApiKey', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsApiKeyCommand","Get-AzApplicationInsightsApiKey","0","2000","The cmdlet 'Get-AzApplicationInsightsApiKey' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Get-AzApplicationInsightsApiKey', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsApiKeyCommand","Get-AzApplicationInsightsApiKey","0","2020","The cmdlet 'Get-AzApplicationInsightsApiKey' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsApiKeyCommand","Get-AzApplicationInsightsApiKey","0","2010","The cmdlet 'Get-AzApplicationInsightsApiKey' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsApiKeyCommand","Get-AzApplicationInsightsApiKey","0","2010","The cmdlet 'Get-AzApplicationInsightsApiKey' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsApiKeyCommand","Get-AzApplicationInsightsApiKey","0","1050","The parameter set 'ComponentObjectParameterSet' for cmdlet 'Get-AzApplicationInsightsApiKey' has been removed.","Add parameter set 'ComponentObjectParameterSet' back to cmdlet 'Get-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsApiKeyCommand","Get-AzApplicationInsightsApiKey","0","1050","The parameter set 'ResourceIdParameterSet' for cmdlet 'Get-AzApplicationInsightsApiKey' has been removed.","Add parameter set 'ResourceIdParameterSet' back to cmdlet 'Get-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsApiKeyCommand","Get-AzApplicationInsightsApiKey","0","1050","The parameter set 'ComponentNameParameterSet' for cmdlet 'Get-AzApplicationInsightsApiKey' has been removed.","Add parameter set 'ComponentNameParameterSet' back to cmdlet 'Get-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsApiKeyCommand","Get-AzApplicationInsightsApiKey","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Get-AzApplicationInsightsApiKey' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Get-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsContinuousExportCommand","Get-AzApplicationInsightsContinuousExport","0","1020","The cmdlet 'Get-AzApplicationInsightsContinuousExport' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSExportConfiguration'.","Make cmdlet 'Get-AzApplicationInsightsContinuousExport' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSExportConfiguration'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsContinuousExportCommand","Get-AzApplicationInsightsContinuousExport","0","1060","The parameter set 'ComponentNameParameterSet' for cmdlet 'Get-AzApplicationInsightsContinuousExport' is no longer the default parameter set.","Change the default parameter for cmdlet 'Get-AzApplicationInsightsContinuousExport' back to 'ComponentNameParameterSet'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsContinuousExportCommand","Get-AzApplicationInsightsContinuousExport","0","2000","The cmdlet 'Get-AzApplicationInsightsContinuousExport' no longer supports the parameter 'ApplicationInsightsComponent' and no alias was found for the original parameter name.","Add the parameter 'ApplicationInsightsComponent' back to the cmdlet 'Get-AzApplicationInsightsContinuousExport', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsContinuousExportCommand","Get-AzApplicationInsightsContinuousExport","0","2000","The cmdlet 'Get-AzApplicationInsightsContinuousExport' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Get-AzApplicationInsightsContinuousExport', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsContinuousExportCommand","Get-AzApplicationInsightsContinuousExport","0","2020","The cmdlet 'Get-AzApplicationInsightsContinuousExport' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsContinuousExportCommand","Get-AzApplicationInsightsContinuousExport","0","2010","The cmdlet 'Get-AzApplicationInsightsContinuousExport' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsContinuousExportCommand","Get-AzApplicationInsightsContinuousExport","0","2010","The cmdlet 'Get-AzApplicationInsightsContinuousExport' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsContinuousExportCommand","Get-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ComponentObjectParameterSet' for cmdlet 'Get-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ComponentObjectParameterSet' back to cmdlet 'Get-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsContinuousExportCommand","Get-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ResourceIdParameterSet' for cmdlet 'Get-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ResourceIdParameterSet' back to cmdlet 'Get-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsContinuousExportCommand","Get-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ComponentNameParameterSet' for cmdlet 'Get-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ComponentNameParameterSet' back to cmdlet 'Get-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.GetApplicationInsightsContinuousExportCommand","Get-AzApplicationInsightsContinuousExport","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Get-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Get-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.GetApplicationInsightsLinkedStorageAccount","Get-AzApplicationInsightsLinkedStorageAccount","0","1020","The cmdlet 'Get-AzApplicationInsightsLinkedStorageAccount' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSComponentLinkedStorageAccounts'.","Make cmdlet 'Get-AzApplicationInsightsLinkedStorageAccount' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSComponentLinkedStorageAccounts'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.GetApplicationInsightsLinkedStorageAccount","Get-AzApplicationInsightsLinkedStorageAccount","0","2020","The cmdlet 'Get-AzApplicationInsightsLinkedStorageAccount' no longer supports the type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent' for parameter 'InputObject'.","Change the type for parameter 'InputObject' back to 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.GetApplicationInsightsLinkedStorageAccount","Get-AzApplicationInsightsLinkedStorageAccount","0","2000","The cmdlet 'Get-AzApplicationInsightsLinkedStorageAccount' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Get-AzApplicationInsightsLinkedStorageAccount', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.GetApplicationInsightsLinkedStorageAccount","Get-AzApplicationInsightsLinkedStorageAccount","0","2020","The cmdlet 'Get-AzApplicationInsightsLinkedStorageAccount' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.GetApplicationInsightsLinkedStorageAccount","Get-AzApplicationInsightsLinkedStorageAccount","0","2010","The cmdlet 'Get-AzApplicationInsightsLinkedStorageAccount' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.GetApplicationInsightsLinkedStorageAccount","Get-AzApplicationInsightsLinkedStorageAccount","0","2010","The cmdlet 'Get-AzApplicationInsightsLinkedStorageAccount' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.GetApplicationInsightsLinkedStorageAccount","Get-AzApplicationInsightsLinkedStorageAccount","0","1050","The parameter set 'ByResourceIdParameterSet' for cmdlet 'Get-AzApplicationInsightsLinkedStorageAccount' has been removed.","Add parameter set 'ByResourceIdParameterSet' back to cmdlet 'Get-AzApplicationInsightsLinkedStorageAccount'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsights","New-AzApplicationInsights","0","1020","The cmdlet 'New-AzApplicationInsights' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent'.","Make cmdlet 'New-AzApplicationInsights' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsights","New-AzApplicationInsights","0","2020","The cmdlet 'New-AzApplicationInsights' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsights","New-AzApplicationInsights","0","2010","The cmdlet 'New-AzApplicationInsights' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsights","New-AzApplicationInsights","0","2010","The cmdlet 'New-AzApplicationInsights' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsights","New-AzApplicationInsights","0","2020","The cmdlet 'New-AzApplicationInsights' no longer supports the type 'System.Nullable`1[System.Int32]' for parameter 'RetentionInDays'.","Change the type for parameter 'RetentionInDays' back to 'System.Nullable`1[System.Int32]'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsights","New-AzApplicationInsights","0","2020","The cmdlet 'New-AzApplicationInsights' no longer supports the type 'System.String' for parameter 'PublicNetworkAccessForIngestion'.","Change the type for parameter 'PublicNetworkAccessForIngestion' back to 'System.String'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsights","New-AzApplicationInsights","0","2020","The cmdlet 'New-AzApplicationInsights' no longer supports the type 'System.String' for parameter 'PublicNetworkAccessForQuery'.","Change the type for parameter 'PublicNetworkAccessForQuery' back to 'System.String'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsights","New-AzApplicationInsights","0","1050","The parameter set '__AllParameterSets' for cmdlet 'New-AzApplicationInsights' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'New-AzApplicationInsights'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsApiKeyCommand","New-AzApplicationInsightsApiKey","0","1020","The cmdlet 'New-AzApplicationInsightsApiKey' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApiKey'.","Make cmdlet 'New-AzApplicationInsightsApiKey' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsApiKeyCommand","New-AzApplicationInsightsApiKey","0","2000","The cmdlet 'New-AzApplicationInsightsApiKey' no longer supports the parameter 'ApplicationInsightsComponent' and no alias was found for the original parameter name.","Add the parameter 'ApplicationInsightsComponent' back to the cmdlet 'New-AzApplicationInsightsApiKey', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsApiKeyCommand","New-AzApplicationInsightsApiKey","0","2000","The cmdlet 'New-AzApplicationInsightsApiKey' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'New-AzApplicationInsightsApiKey', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsApiKeyCommand","New-AzApplicationInsightsApiKey","0","2020","The cmdlet 'New-AzApplicationInsightsApiKey' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsApiKeyCommand","New-AzApplicationInsightsApiKey","0","2010","The cmdlet 'New-AzApplicationInsightsApiKey' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsApiKeyCommand","New-AzApplicationInsightsApiKey","0","2010","The cmdlet 'New-AzApplicationInsightsApiKey' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsApiKeyCommand","New-AzApplicationInsightsApiKey","0","1050","The parameter set 'ComponentObjectParameterSet' for cmdlet 'New-AzApplicationInsightsApiKey' has been removed.","Add parameter set 'ComponentObjectParameterSet' back to cmdlet 'New-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsApiKeyCommand","New-AzApplicationInsightsApiKey","0","1050","The parameter set 'ResourceIdParameterSet' for cmdlet 'New-AzApplicationInsightsApiKey' has been removed.","Add parameter set 'ResourceIdParameterSet' back to cmdlet 'New-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsApiKeyCommand","New-AzApplicationInsightsApiKey","0","1050","The parameter set 'ComponentNameParameterSet' for cmdlet 'New-AzApplicationInsightsApiKey' has been removed.","Add parameter set 'ComponentNameParameterSet' back to cmdlet 'New-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsApiKeyCommand","New-AzApplicationInsightsApiKey","0","1050","The parameter set '__AllParameterSets' for cmdlet 'New-AzApplicationInsightsApiKey' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'New-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsContinuousExportCommand","New-AzApplicationInsightsContinuousExport","0","1020","The cmdlet 'New-AzApplicationInsightsContinuousExport' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSExportConfiguration'.","Make cmdlet 'New-AzApplicationInsightsContinuousExport' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSExportConfiguration'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsContinuousExportCommand","New-AzApplicationInsightsContinuousExport","0","2000","The cmdlet 'New-AzApplicationInsightsContinuousExport' no longer supports the parameter 'ApplicationInsightsComponent' and no alias was found for the original parameter name.","Add the parameter 'ApplicationInsightsComponent' back to the cmdlet 'New-AzApplicationInsightsContinuousExport', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsContinuousExportCommand","New-AzApplicationInsightsContinuousExport","0","2000","The cmdlet 'New-AzApplicationInsightsContinuousExport' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'New-AzApplicationInsightsContinuousExport', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsContinuousExportCommand","New-AzApplicationInsightsContinuousExport","0","2000","The cmdlet 'New-AzApplicationInsightsContinuousExport' no longer supports the parameter 'DocumentType' and no alias was found for the original parameter name.","Add the parameter 'DocumentType' back to the cmdlet 'New-AzApplicationInsightsContinuousExport', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsContinuousExportCommand","New-AzApplicationInsightsContinuousExport","0","2020","The cmdlet 'New-AzApplicationInsightsContinuousExport' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsContinuousExportCommand","New-AzApplicationInsightsContinuousExport","0","2010","The cmdlet 'New-AzApplicationInsightsContinuousExport' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsContinuousExportCommand","New-AzApplicationInsightsContinuousExport","0","2010","The cmdlet 'New-AzApplicationInsightsContinuousExport' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsContinuousExportCommand","New-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ComponentObjectParameterSet' for cmdlet 'New-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ComponentObjectParameterSet' back to cmdlet 'New-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsContinuousExportCommand","New-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ResourceIdParameterSet' for cmdlet 'New-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ResourceIdParameterSet' back to cmdlet 'New-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsContinuousExportCommand","New-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ComponentNameParameterSet' for cmdlet 'New-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ComponentNameParameterSet' back to cmdlet 'New-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsightsContinuousExportCommand","New-AzApplicationInsightsContinuousExport","0","1050","The parameter set '__AllParameterSets' for cmdlet 'New-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'New-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.NewApplicationInsightsLinkedStorageAccount","New-AzApplicationInsightsLinkedStorageAccount","0","1020","The cmdlet 'New-AzApplicationInsightsLinkedStorageAccount' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSComponentLinkedStorageAccounts'.","Make cmdlet 'New-AzApplicationInsightsLinkedStorageAccount' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSComponentLinkedStorageAccounts'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.NewApplicationInsightsLinkedStorageAccount","New-AzApplicationInsightsLinkedStorageAccount","0","2000","The cmdlet 'New-AzApplicationInsightsLinkedStorageAccount' no longer supports the parameter 'InputObject' and no alias was found for the original parameter name.","Add the parameter 'InputObject' back to the cmdlet 'New-AzApplicationInsightsLinkedStorageAccount', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.NewApplicationInsightsLinkedStorageAccount","New-AzApplicationInsightsLinkedStorageAccount","0","2000","The cmdlet 'New-AzApplicationInsightsLinkedStorageAccount' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'New-AzApplicationInsightsLinkedStorageAccount', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.NewApplicationInsightsLinkedStorageAccount","New-AzApplicationInsightsLinkedStorageAccount","0","2020","The cmdlet 'New-AzApplicationInsightsLinkedStorageAccount' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.NewApplicationInsightsLinkedStorageAccount","New-AzApplicationInsightsLinkedStorageAccount","0","2010","The cmdlet 'New-AzApplicationInsightsLinkedStorageAccount' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.NewApplicationInsightsLinkedStorageAccount","New-AzApplicationInsightsLinkedStorageAccount","0","2010","The cmdlet 'New-AzApplicationInsightsLinkedStorageAccount' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.NewApplicationInsightsLinkedStorageAccount","New-AzApplicationInsightsLinkedStorageAccount","0","1050","The parameter set 'ByInputObjectParameterSet' for cmdlet 'New-AzApplicationInsightsLinkedStorageAccount' has been removed.","Add parameter set 'ByInputObjectParameterSet' back to cmdlet 'New-AzApplicationInsightsLinkedStorageAccount'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.NewApplicationInsightsLinkedStorageAccount","New-AzApplicationInsightsLinkedStorageAccount","0","1050","The parameter set 'ByResourceIdParameterSet' for cmdlet 'New-AzApplicationInsightsLinkedStorageAccount' has been removed.","Add parameter set 'ByResourceIdParameterSet' back to cmdlet 'New-AzApplicationInsightsLinkedStorageAccount'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.NewApplicationInsightsLinkedStorageAccount","New-AzApplicationInsightsLinkedStorageAccount","0","1050","The parameter set '__AllParameterSets' for cmdlet 'New-AzApplicationInsightsLinkedStorageAccount' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'New-AzApplicationInsightsLinkedStorageAccount'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponent","Remove-AzApplicationInsights","0","2000","The cmdlet 'Remove-AzApplicationInsights' no longer supports the parameter 'ApplicationInsightsComponent' and no alias was found for the original parameter name.","Add the parameter 'ApplicationInsightsComponent' back to the cmdlet 'Remove-AzApplicationInsights', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponent","Remove-AzApplicationInsights","0","2000","The cmdlet 'Remove-AzApplicationInsights' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Remove-AzApplicationInsights', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponent","Remove-AzApplicationInsights","0","2020","The cmdlet 'Remove-AzApplicationInsights' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponent","Remove-AzApplicationInsights","0","2010","The cmdlet 'Remove-AzApplicationInsights' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponent","Remove-AzApplicationInsights","0","2010","The cmdlet 'Remove-AzApplicationInsights' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponent","Remove-AzApplicationInsights","0","1050","The parameter set 'ComponentObjectParameterSet' for cmdlet 'Remove-AzApplicationInsights' has been removed.","Add parameter set 'ComponentObjectParameterSet' back to cmdlet 'Remove-AzApplicationInsights'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponent","Remove-AzApplicationInsights","0","1050","The parameter set 'ResourceIdParameterSet' for cmdlet 'Remove-AzApplicationInsights' has been removed.","Add parameter set 'ResourceIdParameterSet' back to cmdlet 'Remove-AzApplicationInsights'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponent","Remove-AzApplicationInsights","0","1050","The parameter set 'ComponentNameParameterSet' for cmdlet 'Remove-AzApplicationInsights' has been removed.","Add parameter set 'ComponentNameParameterSet' back to cmdlet 'Remove-AzApplicationInsights'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationComponentInsightsApiKey","Remove-AzApplicationInsightsApiKey","0","1060","The parameter set 'ComponentNameParameterSet' for cmdlet 'Remove-AzApplicationInsightsApiKey' is no longer the default parameter set.","Change the default parameter for cmdlet 'Remove-AzApplicationInsightsApiKey' back to 'ComponentNameParameterSet'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationComponentInsightsApiKey","Remove-AzApplicationInsightsApiKey","0","2000","The cmdlet 'Remove-AzApplicationInsightsApiKey' no longer supports the parameter 'ApplicationInsightsComponent' and no alias was found for the original parameter name.","Add the parameter 'ApplicationInsightsComponent' back to the cmdlet 'Remove-AzApplicationInsightsApiKey', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationComponentInsightsApiKey","Remove-AzApplicationInsightsApiKey","0","2000","The cmdlet 'Remove-AzApplicationInsightsApiKey' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Remove-AzApplicationInsightsApiKey', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationComponentInsightsApiKey","Remove-AzApplicationInsightsApiKey","0","2000","The cmdlet 'Remove-AzApplicationInsightsApiKey' no longer supports the parameter 'PassThru' and no alias was found for the original parameter name.","Add the parameter 'PassThru' back to the cmdlet 'Remove-AzApplicationInsightsApiKey', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationComponentInsightsApiKey","Remove-AzApplicationInsightsApiKey","0","2020","The cmdlet 'Remove-AzApplicationInsightsApiKey' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationComponentInsightsApiKey","Remove-AzApplicationInsightsApiKey","0","2010","The cmdlet 'Remove-AzApplicationInsightsApiKey' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationComponentInsightsApiKey","Remove-AzApplicationInsightsApiKey","0","2010","The cmdlet 'Remove-AzApplicationInsightsApiKey' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationComponentInsightsApiKey","Remove-AzApplicationInsightsApiKey","0","1050","The parameter set 'ComponentObjectParameterSet' for cmdlet 'Remove-AzApplicationInsightsApiKey' has been removed.","Add parameter set 'ComponentObjectParameterSet' back to cmdlet 'Remove-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationComponentInsightsApiKey","Remove-AzApplicationInsightsApiKey","0","1050","The parameter set 'ResourceIdParameterSet' for cmdlet 'Remove-AzApplicationInsightsApiKey' has been removed.","Add parameter set 'ResourceIdParameterSet' back to cmdlet 'Remove-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationComponentInsightsApiKey","Remove-AzApplicationInsightsApiKey","0","1050","The parameter set 'ComponentNameParameterSet' for cmdlet 'Remove-AzApplicationInsightsApiKey' has been removed.","Add parameter set 'ComponentNameParameterSet' back to cmdlet 'Remove-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationComponentInsightsApiKey","Remove-AzApplicationInsightsApiKey","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Remove-AzApplicationInsightsApiKey' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Remove-AzApplicationInsightsApiKey'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponentContinuousExport","Remove-AzApplicationInsightsContinuousExport","0","1060","The parameter set 'ComponentNameParameterSet' for cmdlet 'Remove-AzApplicationInsightsContinuousExport' is no longer the default parameter set.","Change the default parameter for cmdlet 'Remove-AzApplicationInsightsContinuousExport' back to 'ComponentNameParameterSet'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponentContinuousExport","Remove-AzApplicationInsightsContinuousExport","0","2000","The cmdlet 'Remove-AzApplicationInsightsContinuousExport' no longer supports the parameter 'ApplicationInsightsComponent' and no alias was found for the original parameter name.","Add the parameter 'ApplicationInsightsComponent' back to the cmdlet 'Remove-AzApplicationInsightsContinuousExport', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponentContinuousExport","Remove-AzApplicationInsightsContinuousExport","0","2000","The cmdlet 'Remove-AzApplicationInsightsContinuousExport' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Remove-AzApplicationInsightsContinuousExport', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponentContinuousExport","Remove-AzApplicationInsightsContinuousExport","0","2000","The cmdlet 'Remove-AzApplicationInsightsContinuousExport' no longer supports the parameter 'PassThru' and no alias was found for the original parameter name.","Add the parameter 'PassThru' back to the cmdlet 'Remove-AzApplicationInsightsContinuousExport', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponentContinuousExport","Remove-AzApplicationInsightsContinuousExport","0","2020","The cmdlet 'Remove-AzApplicationInsightsContinuousExport' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponentContinuousExport","Remove-AzApplicationInsightsContinuousExport","0","2010","The cmdlet 'Remove-AzApplicationInsightsContinuousExport' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponentContinuousExport","Remove-AzApplicationInsightsContinuousExport","0","2010","The cmdlet 'Remove-AzApplicationInsightsContinuousExport' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponentContinuousExport","Remove-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ComponentObjectParameterSet' for cmdlet 'Remove-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ComponentObjectParameterSet' back to cmdlet 'Remove-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponentContinuousExport","Remove-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ResourceIdParameterSet' for cmdlet 'Remove-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ResourceIdParameterSet' back to cmdlet 'Remove-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponentContinuousExport","Remove-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ComponentNameParameterSet' for cmdlet 'Remove-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ComponentNameParameterSet' back to cmdlet 'Remove-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.RemoveApplicationInsightsComponentContinuousExport","Remove-AzApplicationInsightsContinuousExport","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Remove-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Remove-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.RemoveApplicationInsightsLinkedStorageAccount","Remove-AzApplicationInsightsLinkedStorageAccount","0","2020","The cmdlet 'Remove-AzApplicationInsightsLinkedStorageAccount' no longer supports the type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent' for parameter 'InputObject'.","Change the type for parameter 'InputObject' back to 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.RemoveApplicationInsightsLinkedStorageAccount","Remove-AzApplicationInsightsLinkedStorageAccount","0","2000","The cmdlet 'Remove-AzApplicationInsightsLinkedStorageAccount' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Remove-AzApplicationInsightsLinkedStorageAccount', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.RemoveApplicationInsightsLinkedStorageAccount","Remove-AzApplicationInsightsLinkedStorageAccount","0","2020","The cmdlet 'Remove-AzApplicationInsightsLinkedStorageAccount' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.RemoveApplicationInsightsLinkedStorageAccount","Remove-AzApplicationInsightsLinkedStorageAccount","0","2010","The cmdlet 'Remove-AzApplicationInsightsLinkedStorageAccount' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.RemoveApplicationInsightsLinkedStorageAccount","Remove-AzApplicationInsightsLinkedStorageAccount","0","2010","The cmdlet 'Remove-AzApplicationInsightsLinkedStorageAccount' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.RemoveApplicationInsightsLinkedStorageAccount","Remove-AzApplicationInsightsLinkedStorageAccount","0","1050","The parameter set 'ByResourceIdParameterSet' for cmdlet 'Remove-AzApplicationInsightsLinkedStorageAccount' has been removed.","Add parameter set 'ByResourceIdParameterSet' back to cmdlet 'Remove-AzApplicationInsightsLinkedStorageAccount'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsContinuousExportCommand","Set-AzApplicationInsightsContinuousExport","0","1020","The cmdlet 'Set-AzApplicationInsightsContinuousExport' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSExportConfiguration'.","Make cmdlet 'Set-AzApplicationInsightsContinuousExport' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSExportConfiguration'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsContinuousExportCommand","Set-AzApplicationInsightsContinuousExport","0","2000","The cmdlet 'Set-AzApplicationInsightsContinuousExport' no longer supports the parameter 'ApplicationInsightsComponent' and no alias was found for the original parameter name.","Add the parameter 'ApplicationInsightsComponent' back to the cmdlet 'Set-AzApplicationInsightsContinuousExport', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsContinuousExportCommand","Set-AzApplicationInsightsContinuousExport","0","2000","The cmdlet 'Set-AzApplicationInsightsContinuousExport' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Set-AzApplicationInsightsContinuousExport', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsContinuousExportCommand","Set-AzApplicationInsightsContinuousExport","0","2000","The cmdlet 'Set-AzApplicationInsightsContinuousExport' no longer supports the parameter 'DocumentType' and no alias was found for the original parameter name.","Add the parameter 'DocumentType' back to the cmdlet 'Set-AzApplicationInsightsContinuousExport', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsContinuousExportCommand","Set-AzApplicationInsightsContinuousExport","0","2020","The cmdlet 'Set-AzApplicationInsightsContinuousExport' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsContinuousExportCommand","Set-AzApplicationInsightsContinuousExport","0","2010","The cmdlet 'Set-AzApplicationInsightsContinuousExport' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsContinuousExportCommand","Set-AzApplicationInsightsContinuousExport","0","2010","The cmdlet 'Set-AzApplicationInsightsContinuousExport' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsContinuousExportCommand","Set-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ComponentObjectParameterSet' for cmdlet 'Set-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ComponentObjectParameterSet' back to cmdlet 'Set-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsContinuousExportCommand","Set-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ResourceIdParameterSet' for cmdlet 'Set-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ResourceIdParameterSet' back to cmdlet 'Set-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsContinuousExportCommand","Set-AzApplicationInsightsContinuousExport","0","1050","The parameter set 'ComponentNameParameterSet' for cmdlet 'Set-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set 'ComponentNameParameterSet' back to cmdlet 'Set-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsContinuousExportCommand","Set-AzApplicationInsightsContinuousExport","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Set-AzApplicationInsightsContinuousExport' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Set-AzApplicationInsightsContinuousExport'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsDailyCapCommand","Set-AzApplicationInsightsDailyCap","0","1020","The cmdlet 'Set-AzApplicationInsightsDailyCap' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSPricingPlan'.","Make cmdlet 'Set-AzApplicationInsightsDailyCap' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSPricingPlan'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsDailyCapCommand","Set-AzApplicationInsightsDailyCap","0","2000","The cmdlet 'Set-AzApplicationInsightsDailyCap' no longer supports the parameter 'ApplicationInsightsComponent' and no alias was found for the original parameter name.","Add the parameter 'ApplicationInsightsComponent' back to the cmdlet 'Set-AzApplicationInsightsDailyCap', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsDailyCapCommand","Set-AzApplicationInsightsDailyCap","0","2000","The cmdlet 'Set-AzApplicationInsightsDailyCap' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Set-AzApplicationInsightsDailyCap', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsDailyCapCommand","Set-AzApplicationInsightsDailyCap","0","2020","The cmdlet 'Set-AzApplicationInsightsDailyCap' no longer supports the type 'System.Nullable`1[System.Double]' for parameter 'DailyCapGB'.","Change the type for parameter 'DailyCapGB' back to 'System.Nullable`1[System.Double]'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsDailyCapCommand","Set-AzApplicationInsightsDailyCap","0","2020","The cmdlet 'Set-AzApplicationInsightsDailyCap' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsDailyCapCommand","Set-AzApplicationInsightsDailyCap","0","2010","The cmdlet 'Set-AzApplicationInsightsDailyCap' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsDailyCapCommand","Set-AzApplicationInsightsDailyCap","0","2010","The cmdlet 'Set-AzApplicationInsightsDailyCap' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsDailyCapCommand","Set-AzApplicationInsightsDailyCap","0","1050","The parameter set 'ComponentObjectParameterSet' for cmdlet 'Set-AzApplicationInsightsDailyCap' has been removed.","Add parameter set 'ComponentObjectParameterSet' back to cmdlet 'Set-AzApplicationInsightsDailyCap'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsDailyCapCommand","Set-AzApplicationInsightsDailyCap","0","1050","The parameter set 'ResourceIdParameterSet' for cmdlet 'Set-AzApplicationInsightsDailyCap' has been removed.","Add parameter set 'ResourceIdParameterSet' back to cmdlet 'Set-AzApplicationInsightsDailyCap'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsDailyCapCommand","Set-AzApplicationInsightsDailyCap","0","1050","The parameter set 'ComponentNameParameterSet' for cmdlet 'Set-AzApplicationInsightsDailyCap' has been removed.","Add parameter set 'ComponentNameParameterSet' back to cmdlet 'Set-AzApplicationInsightsDailyCap'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsDailyCapCommand","Set-AzApplicationInsightsDailyCap","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Set-AzApplicationInsightsDailyCap' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Set-AzApplicationInsightsDailyCap'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsPricingPlanCommand","Set-AzApplicationInsightsPricingPlan","0","1020","The cmdlet 'Set-AzApplicationInsightsPricingPlan' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSPricingPlan'.","Make cmdlet 'Set-AzApplicationInsightsPricingPlan' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSPricingPlan'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsPricingPlanCommand","Set-AzApplicationInsightsPricingPlan","0","2000","The cmdlet 'Set-AzApplicationInsightsPricingPlan' no longer supports the parameter 'ApplicationInsightsComponent' and no alias was found for the original parameter name.","Add the parameter 'ApplicationInsightsComponent' back to the cmdlet 'Set-AzApplicationInsightsPricingPlan', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsPricingPlanCommand","Set-AzApplicationInsightsPricingPlan","0","2000","The cmdlet 'Set-AzApplicationInsightsPricingPlan' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Set-AzApplicationInsightsPricingPlan', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsPricingPlanCommand","Set-AzApplicationInsightsPricingPlan","0","2020","The cmdlet 'Set-AzApplicationInsightsPricingPlan' no longer supports the type 'System.Nullable`1[System.Double]' for parameter 'DailyCapGB'.","Change the type for parameter 'DailyCapGB' back to 'System.Nullable`1[System.Double]'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsPricingPlanCommand","Set-AzApplicationInsightsPricingPlan","0","2020","The cmdlet 'Set-AzApplicationInsightsPricingPlan' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsPricingPlanCommand","Set-AzApplicationInsightsPricingPlan","0","2010","The cmdlet 'Set-AzApplicationInsightsPricingPlan' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsPricingPlanCommand","Set-AzApplicationInsightsPricingPlan","0","2010","The cmdlet 'Set-AzApplicationInsightsPricingPlan' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsPricingPlanCommand","Set-AzApplicationInsightsPricingPlan","0","1050","The parameter set 'ComponentObjectParameterSet' for cmdlet 'Set-AzApplicationInsightsPricingPlan' has been removed.","Add parameter set 'ComponentObjectParameterSet' back to cmdlet 'Set-AzApplicationInsightsPricingPlan'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsPricingPlanCommand","Set-AzApplicationInsightsPricingPlan","0","1050","The parameter set 'ResourceIdParameterSet' for cmdlet 'Set-AzApplicationInsightsPricingPlan' has been removed.","Add parameter set 'ResourceIdParameterSet' back to cmdlet 'Set-AzApplicationInsightsPricingPlan'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsPricingPlanCommand","Set-AzApplicationInsightsPricingPlan","0","1050","The parameter set 'ComponentNameParameterSet' for cmdlet 'Set-AzApplicationInsightsPricingPlan' has been removed.","Add parameter set 'ComponentNameParameterSet' back to cmdlet 'Set-AzApplicationInsightsPricingPlan'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.SetApplicationInsightsPricingPlanCommand","Set-AzApplicationInsightsPricingPlan","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Set-AzApplicationInsightsPricingPlan' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Set-AzApplicationInsightsPricingPlan'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsights+UpdateAzureApplicationInsights","Update-AzApplicationInsights","0","1020","The cmdlet 'Update-AzApplicationInsights' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent'.","Make cmdlet 'Update-AzApplicationInsights' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsights+UpdateAzureApplicationInsights","Update-AzApplicationInsights","0","2020","The cmdlet 'Update-AzApplicationInsights' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsights+UpdateAzureApplicationInsights","Update-AzApplicationInsights","0","2010","The cmdlet 'Update-AzApplicationInsights' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsights+UpdateAzureApplicationInsights","Update-AzApplicationInsights","0","2010","The cmdlet 'Update-AzApplicationInsights' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsights+UpdateAzureApplicationInsights","Update-AzApplicationInsights","0","2020","The cmdlet 'Update-AzApplicationInsights' no longer supports the type 'System.Nullable`1[System.Int32]' for parameter 'RetentionInDays'.","Change the type for parameter 'RetentionInDays' back to 'System.Nullable`1[System.Int32]'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsights+UpdateAzureApplicationInsights","Update-AzApplicationInsights","0","2020","The cmdlet 'Update-AzApplicationInsights' no longer supports the type 'System.String' for parameter 'PublicNetworkAccessForIngestion'.","Change the type for parameter 'PublicNetworkAccessForIngestion' back to 'System.String'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsights+UpdateAzureApplicationInsights","Update-AzApplicationInsights","0","2020","The cmdlet 'Update-AzApplicationInsights' no longer supports the type 'System.String' for parameter 'PublicNetworkAccessForQuery'.","Change the type for parameter 'PublicNetworkAccessForQuery' back to 'System.String'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsights+UpdateAzureApplicationInsights","Update-AzApplicationInsights","0","1050","The parameter set '__AllParameterSets' for cmdlet 'Update-AzApplicationInsights' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'Update-AzApplicationInsights'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsightsLinkedStorageAccount","Update-AzApplicationInsightsLinkedStorageAccount","0","1020","The cmdlet 'Update-AzApplicationInsightsLinkedStorageAccount' no longer has output type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSComponentLinkedStorageAccounts'.","Make cmdlet 'Update-AzApplicationInsightsLinkedStorageAccount' return type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSComponentLinkedStorageAccounts'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsightsLinkedStorageAccount","Update-AzApplicationInsightsLinkedStorageAccount","0","2020","The cmdlet 'Update-AzApplicationInsightsLinkedStorageAccount' no longer supports the type 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent' for parameter 'InputObject'.","Change the type for parameter 'InputObject' back to 'Microsoft.Azure.Commands.ApplicationInsights.Models.PSApplicationInsightsComponent'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsightsLinkedStorageAccount","Update-AzApplicationInsightsLinkedStorageAccount","0","2000","The cmdlet 'Update-AzApplicationInsightsLinkedStorageAccount' no longer supports the parameter 'ResourceId' and no alias was found for the original parameter name.","Add the parameter 'ResourceId' back to the cmdlet 'Update-AzApplicationInsightsLinkedStorageAccount', or add an alias to the original parameter name." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsightsLinkedStorageAccount","Update-AzApplicationInsightsLinkedStorageAccount","0","2020","The cmdlet 'Update-AzApplicationInsightsLinkedStorageAccount' no longer supports the type 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer' for parameter 'DefaultProfile'.","Change the type for parameter 'DefaultProfile' back to 'Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsightsLinkedStorageAccount","Update-AzApplicationInsightsLinkedStorageAccount","0","2010","The cmdlet 'Update-AzApplicationInsightsLinkedStorageAccount' no longer supports the alias 'AzContext' for parameter 'DefaultProfile'.","Add the alias 'AzContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsightsLinkedStorageAccount","Update-AzApplicationInsightsLinkedStorageAccount","0","2010","The cmdlet 'Update-AzApplicationInsightsLinkedStorageAccount' no longer supports the alias 'AzureRmContext' for parameter 'DefaultProfile'.","Add the alias 'AzureRmContext' back to parameter 'DefaultProfile'." +"Az.ApplicationInsights","Microsoft.Azure.Commands.ApplicationInsights.ApplicationInsights.UpdateApplicationInsightsLinkedStorageAccount","Update-AzApplicationInsightsLinkedStorageAccount","0","1050","The parameter set 'ByResourceIdParameterSet' for cmdlet 'Update-AzApplicationInsightsLinkedStorageAccount' has been removed.","Add parameter set 'ByResourceIdParameterSet' back to cmdlet 'Update-AzApplicationInsightsLinkedStorageAccount'." \ No newline at end of file diff --git a/tools/StaticAnalysis/Exceptions/Az.ApplicationInsights/SignatureIssues.csv b/tools/StaticAnalysis/Exceptions/Az.ApplicationInsights/SignatureIssues.csv index b7a790d06cf7..a2e17e164f89 100644 --- a/tools/StaticAnalysis/Exceptions/Az.ApplicationInsights/SignatureIssues.csv +++ b/tools/StaticAnalysis/Exceptions/Az.ApplicationInsights/SignatureIssues.csv @@ -1,4 +1,4 @@ "AssemblyFileName","ClassName","Target","Severity","ProblemId","Description","Remediation" -"Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.dll","Microsoft.Azure.Commands.ApplicationInsights.NewAzureApplicationInsights","New-AzApplicationInsights","1","8420","Parameter set '__AllParameterSets' of cmdlet 'New-AzApplicationInsights' contains at least one parameter with a position larger than four, which is discouraged.","Limit the number of positional parameters in a single parameter set to four or fewer." "Az.ApplicationInsights","New-AzApplicationInsightsWebTestGeolocationObject","New-AzApplicationInsightsWebTestGeolocationObject","1","8100","New-AzApplicationInsightsWebTestGeolocationObject Does not support ShouldProcess but the cmdlet verb New indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue" -"Az.ApplicationInsights","New-AzApplicationInsightsWebTestHeaderFieldObject","New-AzApplicationInsightsWebTestHeaderFieldObject","1","8100","New-AzApplicationInsightsWebTestHeaderFieldObject Does not support ShouldProcess but the cmdlet verb New indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue" \ No newline at end of file +"Az.ApplicationInsights","New-AzApplicationInsightsWebTestHeaderFieldObject","New-AzApplicationInsightsWebTestHeaderFieldObject","1","8100","New-AzApplicationInsightsWebTestHeaderFieldObject Does not support ShouldProcess but the cmdlet verb New indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue" +"Az.ApplicationInsights","Set-AzApplicationInsightsWebTest","Set-AzApplicationInsightsWebTest","1","8410","Parameter PropertiesLocations of cmdlet Set-AzApplicationInsightsWebTest does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name." \ No newline at end of file